Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
saurabh122
Starting Member
16 Posts |
Posted - 2009-03-09 : 05:28:16
|
| is there any way in sql server 2005 to how to find whether a database already exists |
|
|
matty
Posting Yak Master
161 Posts |
Posted - 2009-03-09 : 05:31:33
|
| SELECT * FROM sys.databases WHERE name ='yourdbname' |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-03-09 : 05:53:43
|
| if db_id('yourdbname') is not nullprint 'exists'elseprint 'doesnt exist'MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|