Being a production DBA means having to quickly look at a SQL Server and diagnose issue with it. We know that a quick look at perfmon or task manager can tell us of high CPU usage, but what is a good way to quickly look at proper memory usage. Checking out the Page Life Expectancy […]
Category: Query Tidbits
SQL Server – Cannot resolve collation conflict
A friend of mine contacted me through email today having a very common problem with a query he had written. He received an error, “cannot resolve collation conflict for equal to operator”. Early in my career I had experienced the same issue so I quickly searched my code snippets and found where I had used […]
How to restore the tail end of a transaction log
Have you ever tried to restore a backup over an existing database and receive an error stating the tail of the log for the database has not been backed up? Many times if you are just restoring a database into a development environment you don’t care so you just restore WITH REPLACE and move on. […]
Find the version of the Master DB from a backup
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 […]
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 […]