SQL SERVER – 2005 – A Simple Way To Defragment All Indexes In A Database That Is Fragmented Above A Declared Threshold

Just a day ago, I received email from regular reader Rajiv Kayasthy about a script which demonstrates the A Simple Way To Defragment All Indexes In A Database That Is Fragmented Above A Declared Threshold. He found this script on TechNet BOL and was attempting to run on SQL Server…
Read More

SQL SERVER – Sharpen Your Basic SQL Server Skills – Learn the distinctions between unique constraint and primary key constraint and the easiest way to get random rows from a table

Read my article in SQL Server Magazine March 2007 Edition I will be not able to post complete article here due to copyright issues. Please visit the link above to read the article. [Articles are relocated so links are disabled] Reference : Pinal Dave (https://blog.sqlauthority.com)
Read More

SQL SERVER – How to Retrieve TOP and BOTTOM Rows Together using T-SQL

Just a day ago, while working with some inventory related projects, I faced one interesting situation. I had to find TOP 1 and BOTTOM 1 record together. I right away that I should just do UNION but then I realize that UNION will not work as it will only accept one ORDER BY clause. If you specify more than one ORDER BY clause. It will give an error. Let us see how we can retrieve top and bottom rows together.

Read More

SQL SERVER – Transfer The Logins and The Passwords Between Instances of SQL Server 2005

This question was asked to me by one of reader. “I just upgraded my server with better hardware and newer operating system. How can I transfer the logins and the passwords between two of my SQL Server?” I think Microsoft has wonderful documentation for this issue. kb 918992 I will…
Read More

SQL SERVER – 2005 – Licensing Model Compared to Other Database Products

Yesterday on this blog I wrote about SQL SERVER – 2005 – Understanding Licensing Model. I have received many questions about pricing and comparing SQL Server with other RDBMS. One of the reason I like SQL Server because I am strong believer of licensed software usage and SQL Server is…
Read More