Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning newid(()
Message
From
29/12/2014 17:50:49
 
 
To
29/12/2014 15:32:12
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Environment versions
SQL Server:
SQL Server 2012
Application:
Desktop
Miscellaneous
Thread ID:
01612793
Message ID:
01612812
Views:
63
>Hi Naomi,
>That makes sense and I will give that a test run. I want to return the entire row back.
>I appreciate it.

Hi, Tim,

Naomi's reply is exactly what you need, I just wanted to jump in with 2 more things.

First, the OUTPUT statement has an optional OUTPUT INTO capability. So if you want to redirect the results of your insert (with the newly generated GUIDs and any other derived/calculated columns) to any table (including a temp table), you can. (The table has to exist...OUTPUT INTO won't create a new table on the fly for you)

Second, just curious, since you're using SQL 2012 (which has the new Sequence Object). What's the reason for using a GUID? I realize it's a loaded question, just curious if the requirements call for it.

Thanks...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform