If you're on MS SQL and are inserting multiple rows and want to work with
the inserted identities you could perform a join on the INSERTED table in a
trigger.

On 1/21/08, Kay Smoljak <[EMAIL PROTECTED]> wrote:
>
>
> On Jan 21, 2008 8:25 AM, Taco Fleur <[EMAIL PROTECTED]> wrote:
> <snip>
> > SELECT SCOPE_IDENTITY() AS FormatID
> </snip>
>
> Thanks Taco, you hit the nail on the head - I'm an idiot :)
>
> I did get a response on CF-Talk after all, and Isaac Daley pointed out
> that even the "correct" and working syntax returns multiple rows (one
> for each row in the table) which is a bit inefficient. He suggested I
> go even further and use:
>
> select formatid from format
> where formatid = scope_identity()
>
> which only returns one row. Which is interesting - other than sticking
> that snippet in when I needed it, I'd never really thought much about
> what it was actually doing.
>
> Of course, CF8 returns that same info in a structure, which is much
> handier... but this project is CF7.
>
> Cheers,
> K.
>
> --
> Kay Smoljak
> business: www.cleverstarfish.com
> standards: kay.zombiecoder.com
> coldfusion: kay.smoljak.com
> personal: goatlady.wordpress.com
>
> >
>


-- 
>>> http://www.clickfind.com.au
Looking for a business, product or service? Try the new Australian search
engine www.clickfind.com.au
blog: http://australian-search-engine.blogspot.com/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to