Are you looking for sys.schemas?
IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name="jim")
BEGIN
EXEC('CREATE SCHEMA jim')
END
Note that the CREATE SCHEMA
must be run in its own batch (per the answer below)
Are you looking for sys.schemas?
IF NOT EXISTS (SELECT * FROM sys.schemas WHERE name="jim")
BEGIN
EXEC('CREATE SCHEMA jim')
END
Note that the CREATE SCHEMA
must be run in its own batch (per the answer below)