This is post is going to be very simple but it is something I come across ever so often and find myself having to look up the syntax most of the time. I guess it is one of those things that if you don’t use it often enough you don’t commit it to memory. So […]
Category: Query Tidbits
Shrinking Transaction Logs
I see questions on forums all the time about DBA’s or System Admins finding they are out of drive space due to a very large transaction log. Post vary a bit on what the admin has tried but a common theme is that they have tried shrinking the file but it didn’t shrink and a […]
Listing Stored Procedures From Every Database
Recently I answered a question on AskSSC that I thought I would create a quick blog about. Someone had asked if there was an easy way to run SELECT * FROM SYS.PROCEDURES on every database. I immediately thought of the undocumented stored procedure sp_msforeachdb. I posted a response and gave a bit of advise to […]
Using “NOT IN” in a query can provide mixed results
The topic came up at work awhile back with using various includes/excludes such as IN, NOT IN, and EXISTS. A co-worker was working on an ETL process when he discovered that using “NOT IN” in a sub query with a data set that contained NULL values was giving him incorrect data. Lets take a look […]