schemas.sql 736 B

1234567891011121314151617
  1. if not exists(select s.schema_id from sys.schemas s where s.name = 'data')
  2. and exists(select p.principal_id from sys.database_principals p where p.name = 'dbo') begin
  3. exec sp_executesql N'create schema [data] authorization [dbo]'
  4. end
  5. if not exists(select s.schema_id from sys.schemas s where s.name = 'locosoft')
  6. and exists(select p.principal_id from sys.database_principals p where p.name = 'dbo') begin
  7. exec sp_executesql N'create schema [locosoft] authorization [dbo]'
  8. end
  9. if not exists(select s.schema_id from sys.schemas s where s.name = 'transform')
  10. and exists(select p.principal_id from sys.database_principals p where p.name = 'dbo') begin
  11. exec sp_executesql N'create schema [transform] authorization [dbo]'
  12. end
  13. GO