ORM identity column query VS stored proc
Hi there
Just started using the ORM functionality in CF9.
Just came across an error when I was trying to save a new entity to a table;
Cannot insert explicit value for identity column in table 'ip_bw_list' when IDENTITY_INSERT is set to OFF.
I realise this is because the Identity Specification of the column in SQL Server is set to Yes. So turning this off all is Okay.
So this leads me to my question; Before I used ORM I used stored procs. Because the identity column was specified in SQL as Identity Specification = Yes, I never passed a variable in through a cfprocparam.
But now for ORM to work I must turn it off and therefore If I now use a stored proc I have to pass in the identity column by doing something like;
SELECT IDENT_CURRENT ('my_table') + 1 AS Next_Identity
and passing this into the stored proc.
Am I missing something here? Does anyone have any recommendations about using ORM and stored procs in the same app?
Thank you
Ian
