none
Replication on sql 2005 - SQL Server Management Studio could not save the configuration of 'primdb001' as a Primary.

    Question

  • Hi Im getting below error while creating new replication.  

    sql server 2005 

     TITLE: Microsoft SQL Server Management Studio
    ------------------------------

    SQL Server Management Studio could not save the configuration of 'primdbdb001' as a Primary.

    ------------------------------
    ADDITIONAL INFORMATION:

    An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

    ------------------------------

    Cannot insert the value NULL into column 'owner_sid', table 'msdb.dbo.sysjobs'; column does not allow nulls. INSERT fails.
    The statement has been terminated. (Microsoft SQL Server, Error: 515)

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1399&EvtSrc=MSSQLServer&EvtID=515&LinkId=20476
    Wednesday, May 16, 2018 1:06 AM

Answers

  • Finally fixed this issue 

    Situation
    Database installer throw the following error message:
    Cannot insert the value NULL into column 'owner_sid', table 'msdb.dbo.sysjobs'; column does not allow nulls. INSERT fails.

    Resolution
    Either rename the sa account back to sa, or create an sa account to complete the installation/upgrade.  It does not need to have any admin privileges, just the name. 
    Cause
    When the installer cannot find the 'sa' account in SQL, it tries to insert the value NULL in the owner field, which causes the insert to fail.

    • Marked as answer by J_e_g_a Thursday, May 17, 2018 3:40 AM
    Thursday, May 17, 2018 3:40 AM

All replies

  • anything Im missing ..

    Tested both server link - ok

    hostname - ok

    Permission for user  -ok

     

    Wednesday, May 16, 2018 2:14 AM
  • Hi J_e_g_a

    Can you run following query to check it return your servers name or NUll on both servers?

    SELECT @@Servername

    Regards,

    Pirlo Zhang


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, May 16, 2018 8:24 AM
  • Thanks 

    result showing my servername 

    • Edited by J_e_g_a Wednesday, May 16, 2018 9:27 AM
    Wednesday, May 16, 2018 9:26 AM
  • Hi J_e_g_a,

    Please also check.

    And would you like to enable a database as a primary database in a log shipping configuration or create a Transaction/Snapshot Replication publication?

    Have checked other database and see if this issue persist?

    Regards,

    Pirlo Zhang 


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, May 16, 2018 9:46 AM
  • servername same no issue on it.

    "enable a database as a primary database in a log shipping configuration" - Yes Im Trying  enable primary database in log shipping 

    same server other database also same problem.

    Wednesday, May 16, 2018 9:50 AM
  • Hi J_e_g_a,

    Can you script out your log shipping configuration and run the procs one by one to help further?

    Regards,

    Pirlo Zhang 


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, May 16, 2018 10:08 AM
  • This is details output , its giving error while creating job 

    SQL Server Management Studio could not save the configuration of 'primdb001' as a Primary. (Microsoft SQL Server Management Studio)

    ===================================

    An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

    ------------------------------
    Program Location:

       at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)
       at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand)
       at Microsoft.SqlServer.Management.SqlManagerUI.LogShippingPrimaryServer.Save(LogShippingMonitorServer curMonitorServer, ServerConnection servConn, Server localServer)
       at Microsoft.SqlServer.Management.SqlManagerUI.LogShippingPropertyControl.PersistChange4()

    ===================================

    Cannot insert the value NULL into column 'owner_sid', table 'msdb.dbo.sysjobs'; column does not allow nulls. INSERT fails.
    The statement has been terminated. (.Net SqlClient Data Provider)

    ------------------------------
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.1399&EvtSrc=MSSQLServer&EvtID=515&LinkId=20476

    ------------------------------
    Server Name: primdb001
    Error Number: 515
    Severity: 16
    State: 2
    Procedure: sp_add_job
    Line Number: 137


    ------------------------------
    Program Location:

       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)

    Wednesday, May 16, 2018 10:18 AM
  • I have give full owner rights to user but still having issue 

    Server Name: primdb001
    Error Number: 515
    Severity: 16
    State: 2
    Procedure: sp_add_job
    Line Number: 137

    Cannot insert the value NULL into column 'owner_sid', table 'msdb.dbo.sysjobs'; column does not allow nulls. INSERT fails.

    • Marked as answer by J_e_g_a Thursday, May 17, 2018 3:40 AM
    • Unmarked as answer by J_e_g_a Thursday, May 17, 2018 3:40 AM
    Thursday, May 17, 2018 2:29 AM
  • Hi J_e_g_a,

    I would suggest you check if your environment meets the requirement of Log shipping,

    Step By Step SQL Server Log Shipping

    Make sure your configuration is proper.

    Regards,

    Pirlo Zhang


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, May 17, 2018 2:45 AM
  • Finally fixed this issue 

    Situation
    Database installer throw the following error message:
    Cannot insert the value NULL into column 'owner_sid', table 'msdb.dbo.sysjobs'; column does not allow nulls. INSERT fails.

    Resolution
    Either rename the sa account back to sa, or create an sa account to complete the installation/upgrade.  It does not need to have any admin privileges, just the name. 
    Cause
    When the installer cannot find the 'sa' account in SQL, it tries to insert the value NULL in the owner field, which causes the insert to fail.

    • Marked as answer by J_e_g_a Thursday, May 17, 2018 3:40 AM
    Thursday, May 17, 2018 3:40 AM