Sunday, November 15, 2009

Check database exists or not before delete it

Be very careful before running this query!

IF EXISTS (
SELECT name
FROM sys.databases
WHERE name = N'YourDBName'
)
DROP DATABASE YourDBName
GO

No comments:

Post a Comment