HEELPBOOK - T-SQL - Control if a database exists before creating or dropping it ############################### To test if I can drop the database: IF db_id('Database1') is not null DROP DATABASE Database1 On the other case, to test if I can create the database: IF db_id('Database1') is null CREATE DATABASE Database1 ############ ARTICLE INFO ############# Article Month: November Article Date: 21/11/2012 Permalink: http://localhost/heelpbook/2012/t-sql-control-if-a-database-exists-before-creating-or-dropping-it/ Source: http://dbaspot.com/ms-sqlserver/211872-t-sql-control-if-database-exists-before-creating-dropping.html Language: English View more articles on: http://www.heelpbook.net/ Follow us on Facebook: http://it-it.facebook.com/pages/HeelpBook/100790870008832 Follow us on Twitter: https://twitter.com/#!/HeelpBook Follow us on RSS Feed: http://feeds.feedburner.com/Heelpbook Follow us on Delicious: http://delicious.com/heelpbook Linkedin: http://it.linkedin.com/pub/stefano-maggi/27/73a/b20 Google+ : https://plus.google.com/116990277568167008289/posts