Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
Error running stored procedure using the SQL API
-
While using the SQL API, I am receiving the error:
Msg 50000, Level 16, State 42, Procedure HandleError, Line 29 50000
16
42HandleError
29515
162
Events_RaiseEvent22
Cannot insert the value NULL into column 'User_Name', table 'BuildMaster.dbo.EventOccurences'; column does not allow nulls. INSERT fails.Is there a solution to this problem?
-
Before directly executing a stored procedure, you will need to set the CONTEXT_INFO. This information is used to trigger events and set the value of the CreatedBy and LastModified user name. This only needs to be done once per connection, and you can use this script to set it:
DECLARE @B VARBINARY(MAX) SET @B = CAST('yourname' AS VARBINARY) SET CONTEXT_INFO @B
Obviously, "yourname" should be replaced with a more meaningful string, but it doesn't have to be your username. It could be "SQLAPI".