tags:

views:

38

answers:

1

In ColdFusion 9, after doing an EntitySave, I'd like to get the value of the primary key that was inserted (provided of course that EntitySave did an Insert).

In the old days I would

SELECT * FROM tablename
WHERE PK = SCOPE_IDENTITY()

And this would give me all the fields, including the defaults that SQL Server had assigned.

+4  A: 

After you do a EntitySave(someobject) doesn't someobject.getNameofIDfield() return your PK?

jarofclay
Oh yeah! I'll try that! Thanks!
cf_PhillipSenn