Schema creations must be the only statement in a batch. One way to get around it is like so:
IF (NOT EXISTS (SELECT * FROM sys.schemas WHERE name="acme"))
BEGIN
EXEC ('CREATE SCHEMA [acme] AUTHORIZATION [dbo]')
END
Schema creations must be the only statement in a batch. One way to get around it is like so:
IF (NOT EXISTS (SELECT * FROM sys.schemas WHERE name="acme"))
BEGIN
EXEC ('CREATE SCHEMA [acme] AUTHORIZATION [dbo]')
END