During the recent Comprehensive Database Performance Health Check, I was asked if I know any trick to identify column with a Specific Name in the database.
I love my job because I get to help people learn new technology as well as help them clear their confusion about the older technology. Recently during SQL Server Performance Tuning Practical Workshop, I was asked a very simple but interesting question by an attendee about NVARCHAR column.
This question came up in the recent SQL Server Performance Tuning Practical Workshop. During the workshop, I have answer questions of users during lunch break. One of the users had a very interesting scenario where he had to change one of their employee’s email address for technical reasons but before he changes that he needed to count in every single place where the email exists. I have simulated the same situation in this blog post and we will see how we can count a particular value across all the columns of the table.
A Very popular question I often here whenever I am presenting at the developer conference – How to Change Column Property From NULL to Not NULL Value?
Today, we will see a very interesting puzzle about data types and default values.
You need to answer-
1 The original datatype A and default value B
2 The new datatype C and new default value D
In SQL Server, there are many methods to find out the column names in a table. If you want to find out the column names based on the ordinal position you can do it querying system view size. Columns. Do you know that you can also do this by using COL_NAME() system function?