Try researching recovering the master database online and you will see countless references to having to have SQL at the same version and builld level as the backup of the master database. Since most folks probably don’t have a routine in place to record the version number each time SQL server is patched we need […]
Category: Query Tidbits
Collect Database File Size with Powershell
I decided to start monitoring the amount of free space in my database files so that I can make sure all my databases are set to auto grow by the right amount and to monitor the amount of free space so I can schedule the expansion of the files rather than let them auto grow. […]
Change Database Owner
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 […]
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 […]