Enforce case-insensitive unique user names in a case-sensitive database using an indexed computed column with an explicit collation.
SQL SERVER – Performance: OR vs IN – A Summary and Further Reading
The varied responses led me to write a detailed blog post to clarify the correct answer. If you missed it, you can read it here. Let us see A Summary and Further Reading.
SQL SERVER – Scripts to Retrieve Column Names
Understanding how to retrieve column names from a table is one of the fundamental operations you should be familiar with.
COUNT(*), COUNT(column) and COUNT(DISTINCT): Basics That Trip People
Why do two counts of the same table disagree? Five tiny demos show NULL, blank text, LEFT JOIN placeholders, bigint and join multiplication.
SQL SERVER – Computed Column and Compute Scalar Operators
One of my clients recently asked me a very interesting question about the computed column and Compute Scalar Operators. Let us learn about it today.
SQL SERVER – Having Two Identity Columns for A Single Table
In yesterday’s session, a DBA asked an interesting question that if it is possible to have two identity columns for a single table. Yes and No.
AVG of an Integer Column Returns an Integer: Getting Decimals Back
The dashboard says the average is 1 when everyone can see it is 1.5. Here is why AVG does that and the one-line fix.






