Showing posts with label database owner. Show all posts
Showing posts with label database owner. Show all posts

Saturday, December 29, 2012

Query to Set MSSQL Database Owner

This resolves an error encountered disabling the ability to view database properties via SQL Management Studio: "Property Owner is not available for Database '[DB_name]'. This property may not exist for this object, or may not be retrievable due to insufficient access rights. (Microsoft.SqlServer.Smo)" And a related error: "The database owner SID recorded in the master database differs from the database owner SID recorded in database 'XYZ'. You should correct this situation by resetting the owner of database 'XYZ' using the ALTER AUTHORIZATION statement."

Where !DBNAME= database name, and the default System Administrator remains 'sa': 

use !DBNAME
EXEC dbo.sp_changedbowner @loginame = N'sa', @map = false
GO

NSA Leak Bust Points to State Surveillance Deal with Printing Firms

Earlier this week a young government contractor named Reality Winner was accused by police of leaking an internal NSA document to news outle...