Think I may have found the answer at the following site,
http://davidhayden.com/blog/dave/archive/2006/02/16/2803.aspx
It basically says that on your insert statement to append the following statement onto the end of the insert statement:
"SET @.MyParameter = SCOPE_IDENTITY()"
And then on your command object to pass in a parameter with the name of @.MyParameter (with Direction set to output) and then access the parameter after executing the command. Haven't tried it yet but hopefully it works. Is this correct as far you guys know? Is there a better way, lemme know, thanks!
No comments:
Post a Comment