• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

New Here ,
Sep 26, 2008 Sep 26, 2008

Copy link to clipboard

Copied

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.
TOPICS
Advanced techniques

Views

320

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Sep 26, 2008 Sep 26, 2008

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 26, 2008 Sep 26, 2008

Copy link to clipboard

Copied

LATEST
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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation