Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I find out, if database (@DataBaseName) exists?
Message
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
00761718
Message ID:
00761720
Views:
24
This message has been marked as a message which has helped to the initial question of the thread.
>Hi everybody,
>
>Is there a way to check, if the database exists? I know, how to do it for tables, but what about databases?
>
>Thanks.
IF EXISTS ( SELECT * FROM INFORMATION_SCHEMA.SCHEMATA 
			WHERE catalog_name = 'master'	)
	PRINT 'Yes'
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform