USE YourDatabaseName
GO
SET @dbname = ‘YourDatabaseName’
IF NOT EXISTS(SELECT*FROMsys.databasesWHERE name = @dbname )
BEGIN
–Do Something here
END
USE YourDatabaseName
GO
SET @dbname = ‘YourDatabaseName’
IF NOT EXISTS(SELECT*FROMsys.databasesWHERE name = @dbname )
BEGIN
–Do Something here
END
Leave a Reply