How to get current user for a query in SQL Server 2005: SELECT SYSTEM_USER returns the name of the current context, which helps with debugging and security.
SQL SERVER – Deterministic Functions and Nondeterministic Functions
Deterministic functions like ABS, DATEDIFF and ISNULL always return the same result for the same input. Nondeterministic functions like NEWID and RAND do not.
SQL SERVER – Simple Example of WHILE Loop With CONTINUE and BREAK Keywords
I have tried to explain the usage of simple WHILE loop in the first example. BREAK keywords will exit the stop the while loop and control is moved.
SQL SERVER – Get Permissions of My Username / Userlogin on Server / Database
Invited to review a big company’s schema, I wanted to know my own permissions without asking their DBA. fn_my_permissions shows them at server and database level.
SQL SERVER – Difference Between @@Version and xp_msver – Retrieve SQL Server Information
SELECT @@Version gives the SQL Server version, edition and service pack in one string. I compare @@Version and xp_msver, which returns more server details.
SQL SERVER – UDF vs. Stored Procedures and Having vs. WHERE
My first article in SQL Server Magazine, October 2007, covered UDF vs. stored procedures and HAVING vs. WHERE. The article has moved, so its links are off.
SQL SERVER – 2005 – Sample Example of RANKING Functions – ROW_NUMBER, RANK, DENSE_RANK, NTILE
SQL Server 2005 has four ranking functions: ROW_NUMBER, RANK, DENSE_RANK and NTILE. I explain what each returns and show a sample example of all four.







