Reply to Re: SCOPE_INDENTITY() Not Returning

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация