|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Checking to see if a database exists...I'm creating databases programatically in .Net and I want to verify that the
database doesn't exist before creating it. i found the SQL code: IF NOT EXISTS(SELECT * FROM <databasename>) But when I run the code against a known database, even in SQL Management Studio I get a "Incorrect syntax near ')' error. What am i doing wrong? Thanks RSH > I'm creating databases programatically in .Net and I want to verify that IF EXISTS (> the > database doesn't exist before creating it. i found the SQL code: SELECT * FROM Information_Schema.Schemata WHERE Catalog_Name = 'YourDatabaseName' ) /* Database Exists */ ELSE /* Database does not exist */ -- Peace & happy computing, Mike Labosh, MCSD "Mr. McKittrick, after very careful consideration, I have come to the conclusion that this new system SUCKS." -- General Barringer, "War Games"
"Selecting" from a data table
Strangest damn error - database at fault? CRC checksum algorithm 2 different numbers..... Directinput Dir Function just stopped working! Closing event persistent data source (light footprint, secure, supports sql query engine) Finding a webservice server weird problem with XMLSerializer |
|||||||||||||||||||||||