- Jim Nesbitt
- PowerServer
- Friday, 26 May 2023 05:59 PM UTC
Hi
When PowerServer inserts a row into a SQL Server table with an identity column, does it use SCOPE_IDENTITY () to obtain the identity value for the inserted row?
I'm only asking this because the PowerBuilder documentation states that the default value for PowerBuider is @@identity. This may not work correctly in all cases, so I change it to use SCOPE_IDENTITY(), but this isn't possible using PowerServer.
E.g.
If a row is inserted into table T1, and a trigger fires that inserts a row into T2.
@@IDENTITY returns the identity key for the row inserted in T2
SCOPE_IDENTITY() returns the identity key for the row inserted in T1
PowerBuilder identity Reference
https://docs.appeon.com/pb2022/connection_reference/Identity.html
Cheers
Jim
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.