Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
SamC
White Water Yakist
3467 Posts |
Posted - 2005-04-06 : 10:50:57
|
I've got an ASP page which, depending on the context can call one of two stored procs.There's an error that's eluding me - somehow, a NULL is trying to be inserted where it should not. Trouble is, both procs insert in that table, but neither seems to be the culprit.The error message that I display in ASP states the error, but not the name of the stored procedure:quote: Error Number: -2147217900Script: /ad/ad/ad-useredit.aspNative Error: 515SQLState: 23000Source: Microsoft OLE DB Provider for ODBC DriversDescription: [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert the value NULL into column 'MyCol', table 'mydb.dbo.Users'; column does not allow nulls. INSERT fails.
Is there any way I can do something in either proc such that the name of the stored proc is returned in the error to ASP? Unfortunately, it looks like I'll need to pass a parameter to the ASP error reporting routine with a unique ID to include about the line invoking the error....Execute ,,adExecuteNoRecordsIf CheckADOErrors(.ActiveConnection) Then Response.End()End If |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2005-04-06 : 13:47:54
|
Use SQL Profiler to determine which stored procedure is causing the problem. You'll need to add exceptions to the trace. Then the row right after the exception will be the culprit.Tara |
|
|
jhermiz
3564 Posts |
Posted - 2005-04-06 : 16:51:04
|
Also when passing parameters are you setting defaults to those parameters? For instance, I was having a very similiar issue on a procedure I think it was an update procedure that required a value for a parameter. Even if that value was null (which I did not set as a default). After I added a default to the parameter my issue vanished. I try to design with very little null acceptance, those nulls always seem to be the culprits! Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]Imperfection living for perfection -- [url]http://jhermiz.blogspot.com/[/url] |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2005-04-06 : 22:17:08
|
Wouldn't the logic of the ASP page know which proc it is trying to call? Could you just show that when you get an error?CODO ERGO SUM |
|
|
|
|
|
|
|