Using a simple SQL query we can check whether a database exist or not. Refer the below query.
Query:
If the output is greater then 0 then the Database is exist else it's not exist
Replace the DATABASE NAME with the database name you going to check
Query:
SELECT database_id FROM sys.databases WHERE Name = 'DATABASE NAME'
If the output is greater then 0 then the Database is exist else it's not exist
Replace the DATABASE NAME with the database name you going to check
No comments:
Post a Comment