How to: Check if a Microsoft SQL-server database exists?
Here’s an easy, single line statement to check if a database exists in the current SQL-server instance:
IF db_id('db_name') IS NOT NULL
programming.torensma.net: Code Snippets
Here’s an easy, single line statement to check if a database exists in the current SQL-server instance: