Solved

RowGuid and Stored Procedures

Posted on 2001-08-10
4
749 Views
Last Modified: 2008-03-17
Is there something similar to @@Identity that will return the rowguid when you do an insert into a table with a NewID coluimn on it?

Dave
0
Comment
Question by:howesdav
4 Comments
 
LVL 4

Accepted Solution

by:
vindevogel earned 50 total points
Comment Utility
You can do this ...

Declare @GUID UniqueIdentifier

Set @GUID = newid()

Insert into yourtable (PKGUID, FIELDS)
Values (@GUID, @FIELDS)

You don't receive it back, but you create it before, store it and you can still use it.
0
 

Expert Comment

by:CleanupPing
Comment Utility
howesdav:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
Comment Utility
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Award points to vindevogel

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Anthony
EE Cleanup Volunteer
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Performance is the key factor for any successful data integration project, knowing the type of transformation that you’re using is the first step on optimizing the SSIS flow performance, by utilizing the correct transformation or the design alternat…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now