×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: T-SQL
Posted by: userc865b
Added: Aug 30, 2017 3:12 PM
Views: 3
Tags: tsql
transfer schema to User schema an einen Benutzer übertragen. If you cant drop DB ser use this!
  1. SELECT s.name
  2. FROM sys.schemas s
  3. WHERE s.principal_id = USER_ID('TestUser')
  4.  
  5. ALTER AUTHORIZATION ON SCHEMA::db_owner TO dbo;
  6. ALTER AUTHORIZATION ON SCHEMA::db_accessadmin TO dbo;
  7. ALTER AUTHORIZATION ON SCHEMA::db_securityadmin TO dbo;
  8. ALTER AUTHORIZATION ON SCHEMA::db_ddladmin TO dbo;
  9. ALTER AUTHORIZATION ON SCHEMA::db_backupoperator TO dbo;
  10. ALTER AUTHORIZATION ON SCHEMA::db_datareader TO dbo;
  11. ALTER AUTHORIZATION ON SCHEMA::db_datawriter TO dbo;
  12. ALTER AUTHORIZATION ON SCHEMA::db_denydatareader TO dbo;
  13. ALTER AUTHORIZATION ON SCHEMA::db_denydatawriter TO dbo;