I am wondering if there is an elegant way to check for the existence of a DB? In brief, how do test the connection of a db connection string?
Thanks
you can get list of Database with below and check your db name:
USE master GO SELECT name, database_id, create_date FROM sys.databases ; GO