Skip to content

Instantly share code, notes, and snippets.

@mrflo
Created October 16, 2022 06:43
Show Gist options
  • Save mrflo/10f24dc090cbf46f97fd09786818ed4d to your computer and use it in GitHub Desktop.
Save mrflo/10f24dc090cbf46f97fd09786818ed4d to your computer and use it in GitHub Desktop.
Change SQL schema owner back to dbo : run this query on your database then copy paste and execute the result
SELECT 'ALTER SCHEMA dbo TRANSFER ' + SCHEMA_NAME(schema_id) + '.' + name
FROM sys.tables
WHERE schema_id != SCHEMA_ID('dbo');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment