One of the reader of the blog has sent me question regarding how to use DECODE function in SQL Server.
SQL SERVER – Potential Bottlenecks for Performance
In recent GIDS presentation, I was asked can I name potential bottlenecks for performance. I was taken back to my collage life with this question. I remember that I have memorized following names as potential bottlenecks. CPU RAM Hard Disk Network Application Code Today when I look back at this,…
Read MoreSQL SERVER – Prevent Constraint to Allow NULL
With naked eyes, we often spot the evident problems but the specific details are missed many a time. Something similar happened recently. One of the blog readers sent me an email asking about a bug in how CHECK CONSTRAINT works. He suggested that check constraint accepts NULL even though the…
Read MoreSQLAuthority News – Last 5 Days to WIN Windows Phone 7 – 140 Words to Win
You can win Windows 7 Phone by writing only 140 Characters. You need to leave a comment over here: SQLAuthority News – Win Windows Phone from Idera in 140 Characters – A Cartoon Challenge of SQL over here. There are so far around 150 comments and I believe that chances of…
Read MoreSQLAuthority News – Sudden Death of SSD on my Laptop – A Warning for SSD Users
The solid state drive on my personal laptop just died. Here’s the story. I have a DELL XPS laptop which is now 2.5 years old. The laptop had demonstrated no issues. About 6 months ago, I decided to upgrade the hard drive to solid state drive. There was a lot…
Read MoreSQL SERVER – Speaking on T-SQL Worst Practices at Great Indian Developer Summit 2011 – Bangalore
Presenting in front of techies is always fun. I will be speaking at Great Indian Developer Summit 2011 – Bangalore on April 19, 2011. Here is the details of my session: Session Title:“What did I do?” – T-SQL Worst Practices “Oh My God! What did I do?” Chances are you…
Read MoreSQL SERVER – Applying NOLOCK Hint at Query Level – NOLOCK for whole Transaction
Just received very interesting question in email: “How do I apply NOLOCK hint to my whole query. I know that I can use NOLOCK at every table level but I have many tables in my query and I want to apply the same to all the tables. I want to…
Read MoreSQL SERVER – Making Database to Read Only – Changing Database to Read/Write
I recently received the following comments on my earlier blog about Making database to read only.
“Today i was trying to attach the (MDF,NDF,LDF ) sql server 2008 database which i have received from my client. After attachment the database status is showing (Read-Only) (Eg.database name (Read-Only). How do i make to normal mode for the data updation. is there any query available to resolve this problem. Your help will be highly helpful.”
Let’s learn Making Database to Read Only and Changing Database to Read/Write.
SQL SERVER – Finding Location of Log File when Primary Datafile is Crashed
My friend and SQL Expert Vinod Kumar asked a very interesting question in his latest blog post. Quick Quiz:Do you need the primary data file available to backup your transaction log after a crash? This question can have multiple answers. While he asked the question on blog, I was sitting…
Read MoreSQL SERVER – Transaction Log Impact Detection Using DMV – dm_tran_database_transactions
Just a few days ago before I received the email from blog reader asking if there is any DMV which can provide details about the effect of a transaction on the transaction log file. Absolutely! Here is a quick script which can provide the necessary details: SELECT transaction_id, DB_NAME(database_id) DatabaseName, database_transaction_begin_time…
Read More


