Check if a Perticular Database exist or not
Check if a Perticular Database exist or not
This is simple sql query:
USE master
Go
IF EXISTS ( SELECT name
FROM sys.databases
WHERE name = MyDataBase )
PRINT Exists
ELSE
PRINT Does Not Exists
USE master
Go
IF EXISTS ( SELECT name
FROM sys.databases
WHERE name = MyDataBase )
PRINT Exists
ELSE
PRINT Does Not Exists