troubleshooting Question

Delphi 2005 BDP get scope_identity()

Avatar of dygj
dygj asked on
2 Comments1 Solution449 ViewsLast Modified:
Delphi 2005, mssql server 8  Asp .net application

I need to get the new identity value returned after doing an insert into.
Statement are:
bdpcommand_insert.commandtext='Insert into mytable (myfield1,myfield2) values (?,?)'
bdpcommand_getid.commandtext='select scop_identity() as ID'


But I only get 0 as myid, ie the new identity value is not returned.

Any hints how to get the identity of a insert into statement?

(I figured it out how to do it if you insert a new record into a grid reading an article  , but now I am inserting one records from a web form)

I also tried with the following statement without results:
while do
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 2 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros