programming.torensma.net: Code Snippets

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

You can follow any responses to this entry through the RSS 2.0 feed.