Online Home
create proc [dbo].[CheckDbExist](@dbname varchar(500))
as
IF EXISTS (SELECT name FROM master.sys.databases WHERE name = @dbname)
select 'true'
else
raiserror('Database does not exist',16,1);
No comments:
Post a Comment