Speaking in Code

Tuesday, September 23, 2008

Need to Drop a Database and SSMS Cannot Do It

make sure no one is using the database you are about to drop as their 'default' database
Then execute these statements:

ALTER DATABASE db_name
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE

Drop database db_name

Friday, September 12, 2008

Connect to a Remote SQL Server

Add your windows user name and password into your connection cache by doing the following: Start, run, paste this:
C:\WINDOWS\system32\rundll32.exe keymgr.dll, KRShowKeyMgr

SQL 2000 Debug in Query Analyzer with DateTime parameter

Format of the date must be as follows:
yyyy-mm-dd hh:mm:ss.000

e.g. 2008-09-08 10:33:55.000

if you don't follow that format you will get an invalid cast specification error