Today’s blog post is actually a follow up of my earlier blog post SQL SERVER – Copy Data From SSMS Query Result to Excel. In the earlier blog post, we had discussed how to copy data from the resultset. In this blog post, we will discuss how we can directly export data from SSMS Query to Excel.
SQL SERVER – Copy Data From SSMS Query Result to Excel
Just another day I received a question via email about how to Copy Data From SSMS Query Result to Excel? This is indeed a very simple question but trusts me not everyone knows everything and this blog is dedicated to learning new things – a complicated one or even a simple one.
SQL SERVER – Cannot Shrink Log File 2 (SQLAuthorityDB_log) Because the Logical Log File Located at the End of the File is in Use
Learning never stops for a consultant. In this blog, I would share another learning and discuss message: cannot shrink log file because the logical log file located at the end of the file is in use.
SQL SERVER – Measuring the Length of VARCHAR and NVARCHAR Columns with COL_LENGTH
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.
SQL SERVER – How to Count a Particular Value Across All Columns?
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.
SQL Server – Find Distinct Result Sets Using EXCEPT Operator
In my earlier post on “SQL SERVER – Remove Duplicate Rows Using UNION Operator”, I showed a different method of removing duplicate rows from the result set using a UNION operator. Here is another similar method using EXCEPT operator to find distinct results.
SQL SERVER – Performing IF…THEN In T-SQL With IIF Expression
Today, we are going to see one of the most underutilized features of SQL Server IIF. In SQL Server we can performance IF…THEN logic in T-SQL with IIF Expression but I hardly see it being used at most of the organization.





