USE [DRP]
go
IF EXISTS (SELECT *
FROM sys.schemas(nolock)
WHERE name = N'Config')
BEGIN
PRINT 'Config Schema already present'
END
ELSE
BEGIN
EXEC('CREATE SCHEMA [Config]')
PRINT 'Schema created sucessfully'
END
它的工作正常,但如果我使用以下代码它不工作,请帮助我
USE [DRP]
go
IF EXISTS (SELECT *
FROM sys.schemas(nolock)
WHERE name = N'Config')
BEGIN
PRINT 'Config Schema already present'
END
ELSE
BEGIN
CREATE SCHEMA [Config]
PRINT 'Schema created sucessfully'
END