Skip to main content
Participating Frequently
September 26, 2008
Question

Inserts that Return other Info than ScopIdentity() or @@IDENTITY

  • September 26, 2008
  • 2 replies
  • 371 views
Hi all. I'm a newb to CF.

I'm looking to create an insert within a cfquery, but return more than just the @@IDENTITY or ScopeIdentity() from the final result.

What is the best way to do this? The more options you can suggest, the better, as I'm sure they'll come in handy in other situations.

Thanks. Wasn't sure if I should have posted this in the DB category, but we'll see what comes up here. Thanks all.
This topic has been closed for replies.

2 replies

Inspiring
September 27, 2008
What are you trying to retrieve? If it's the value of another column in the same record, how did you manage to insert it without knowing what it was in advance?
Inspiring
September 26, 2008
hannibalcanibal wrote:
> What is the best way to do this?

Best in what way? Technically you can execute multiple statements against ms sql within a single cfquery. Though some people prefer to encapsulate multiple statements in stored procedures, rather than using cfquery.

That said, there are a few issues to be aware of when using cfquery + INSERT under CF8.