|
Posted by Simon Hayes on 09/14/05 11:51
You seem to be confusing two things - uniqueidentifer and identity.
NEWID() generates a new uniqueidentifier value; SCOPE_IDENTITY()
returns the last value generated by an IDENTITY column, which is
usually an integer.
I'm guessing (since you haven't provided a CREATE TABLE statement) that
you're using NEWID() as a default on a column? If so, there is no
function to retrieve the new value - typically you would use NEWID() in
your proc to generate the value, then INSERT it; you can then return
the new value as an output parameter (of data type uniqueidentifier,
not integer).
If this isn't helpful, or my guess is wrong, I suggest you post a
CREATE TABLE script for your table, so that it's clear what data types,
constraints etc you have. You should also clarify what you expect to
get back from the procedure.
Simon
[Back to original message]
|