|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Is there a command that I can run in T-SQL to check if a database already exists before I try and create it?
![]() Last edited by pabloj : June 4th, 2004 at 08:00 AM. Reason: More descriptive subject added |
|
#2
|
|||
|
|||
|
IF NOT EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name = N'YourDatabaseName')
CREATE DATABASE ... GO |
|
#3
|
|||
|
|||
|
Cheers mate!
|
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Do I exist? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|