Solved

RowGuid and Stored Procedures

Posted on 2001-08-10
4
756 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
ID: 6372150
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
ID: 9281862
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
ID: 9776351
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

Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

756 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