Category Archives: SQL Server

Search for Column in SQL Server

This is really useful if you get an error message complaining about a column and you don’t know where or if that column exist. Lets find it using the query below! Search for Column Name SELECT * FROM INFORMATION_SCHEMA.COLUMNS (nolock) … Continue reading

Posted in SQL Server | Leave a comment

Progress of DBCC CHECKDB

Run this to find out progress for dbcc checkdb select percent_complete, command , start_time from sys.dm_exec_requests where command like ‘%dbcc%’ You can also find out progress for long running backups and more! select percent_complete, command , start_time from sys.dm_exec_requests where … Continue reading

Posted in SQL Server, Tips | Leave a comment

Errors when editing a SQL Server Agent job in SQL 2008 R2

Creating an instance of the COM component with CLSID. Do you get this when editing jobs in SQL Server Agent? Then install the latest CU, currently CU 6 for SQL Server 2008 R2. After installing this it fixed my SQL … Continue reading

Posted in SQL Server | Leave a comment

Moving databases

When copying or moving databases to a new server, your new database server will probably have new logins with the same name but the logins will each one have a different sid. To verify this, run this after you’ve completed … Continue reading

Posted in SQL Server | Leave a comment

Shrinking database files

First rule of SQL Server is – You should not shrink files. Second rule is – You should not use auto shrink. Your log files should be enough big to have plenty of room for your data growth without the … Continue reading

Posted in SQL Server | Leave a comment

Large result sets

When doing a sort or other manipulation on a large result set, try to limit it down even though you use “top 100” in your select statement. A “top 100” won’t do any good when running an “order by” cause … Continue reading

Posted in SQL Server, Tips | Leave a comment

How do you want your index?

Defragmented and superfast of course! Don’t just leave them lying there – get you hands dirty and start digging around to see how fragmented they are. All indexes will eventually get fragmented over time so it is good to plan … Continue reading

Posted in index, SQL Server | Leave a comment