Do you know where your variables are? | |
PerlMonks |
Will an MS SQL db table trigger affect the value returned by scope_identity?by wreade (Initiate) |
on Dec 06, 2011 at 17:20 UTC ( [id://942064]=perlquestion: print w/replies, xml ) | Need Help?? |
wreade has asked for the wisdom of the Perl Monks concerning the following question: I am attempting to execute an MS SQL database transaction that:
1. Inserts a record into table A, Steps 1 through 4 perform as expected, but step 5 doesn't return the expected record identity. Instead, zero (0) is the only value returned. If I remove steps 1 through 3 and simply attempt to insert a record into table C, the program still does not return the expected record identity. In other words, the code from steps 1 through 3 are not affecting the code in steps 4 and 5. So, I believe I have isolated the issue to table C. One important difference between table A (from which I can get the identity of the record inserted) and table C is that table A doesn't have any table triggers, while table C has five tiggers (1 insert; 4 updates). Here is the code that inserts a record into table C and attempts to get the identity of the record inserted into that table.
So, will an MS SQL db table trigger affect the value returned by "SCOPE_IDENTITY()"? UPDATE: I've tested the query in $mssql directly on MSSQL Server 2005. The record is inserted and the scope identity is returned. So, this makes me think there is an issue with my version of the Perl module (Sybase.pm,v 1.44 2003/04/03 19:15:13 mpeppler) I am using to connect to the database.
Back to
Seekers of Perl Wisdom
|
|