Cannot insert the value NULL into column 'owner', table 'tempdb.dbo'
Save PDF
Share
Feedback
- Last UpdatedApr 01, 2020
- 1 minute read
The change report from Netwrix Auditor for SQL Server contains the following warning: Collect 'Database' information warning on server: MSSQLSERVER DB: master. Cannot insert the value NULL into column 'owner', table 'tempdb.dbo'
Netwrix Auditor for SQL Server uses the 'sp_helpdb' stored procedure. This stored procedure will fail if any database on the SQL Server does not have an owner.
Perform the following steps to find the database(s) with the 'NULL' owner:
Netwrix Auditor for SQL Server uses the 'sp_helpdb' stored procedure. This stored procedure will fail if any database on the SQL Server does not have an owner.
Perform the following steps to find the database(s) with the 'NULL' owner:
- Connect to the 'MSSQLSERVER' server.
- Run the following statement: use master select name, suser_sname(sid) from sysdatabases
- Look for database without username in second field.
- Please run the following script to change the owner of the database: use problematic_database_name exec sp_changedbowner 'user name' Note: Replace 'user name' with the user name of the account for the database Example: use problematic_database exec sp_changedbowner 'sa'