Skip to content

Commit

Permalink
Fix broken database owner for Northwind (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
potatoqualitee authored Nov 4, 2022
1 parent 2330eb9 commit eaeee8f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions samples/stackoverflow/sql/restore-db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,10 @@ GO
USE [master]
RESTORE DATABASE [pubs] FROM DISK = N'/tmp/pubs.bak' WITH FILE = 1, MOVE N'pubs' TO N'/var/opt/mssql/data/pubs.mdf', MOVE N'pubs_log' TO N'/var/opt/mssql/data/pubs_log.ldf', NOUNLOAD, STATS = 5

GO

USE [master]
ALTER AUTHORIZATION ON DATABASE::[Northwind] TO [sqladmin]
ALTER AUTHORIZATION ON DATABASE::[pubs] TO [sqladmin]

GO
6 changes: 6 additions & 0 deletions sqlinstance/sql/restore-db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,10 @@ GO
USE [master]
RESTORE DATABASE [pubs] FROM DISK = N'/tmp/pubs.bak' WITH FILE = 1, MOVE N'pubs' TO N'/var/opt/mssql/data/pubs.mdf', MOVE N'pubs_log' TO N'/var/opt/mssql/data/pubs_log.ldf', NOUNLOAD, STATS = 5

GO

USE [master]
ALTER AUTHORIZATION ON DATABASE::[Northwind] TO [sqladmin]
ALTER AUTHORIZATION ON DATABASE::[pubs] TO [sqladmin]

GO

0 comments on commit eaeee8f

Please sign in to comment.