Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL commands not executing
Message
De
19/02/2009 07:15:56
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2000
Application:
Desktop
Divers
Thread ID:
01381043
Message ID:
01382840
Vues:
48
Yes, I've had some really long and busy days lately :o)

Thanks for the link by the way . Are you doing a lot of work in asp.net?


>>That was discussed in the other links as well...I guess you didn't read them?
>>
>>
>
>I read them or, to be precise, scanned them.
>
>BTW, I was wondering where have you been the whole day. I figured, that you were probably working :)
>
>>>Tracy,
>>>
>>>Just in case I missed something please also check http://forums.asp.net/p/1386597/2949899.aspx#2949899 the last answer from the SQL Server expert.
>>>
>>>>I think you missed something then because it is not always SCOPE_IDENTITY() is better. It depends.
>>>>
>>>>
>>>>>Hi Tracy,
>>>>>
>>>>>Not sure what did you want to prove with these two links, since both recommend SCOPE_IDENTITY() :)
>>>>>
>>>>>>I disagree. I think it depends on how you make your updates and if there are any triggers or child tables and what identity you are trying to verify. SCOPE_IDENTITY() is limited to values inserted only within the current scope while @@IDENTITY is not. It is limited by session only. I guess he could use IDENT_CURRENT if he wanted to limit it to a specific table and he didn't care which connection added the record. I know most recommend SCOPE_IDENTITY() in case triggers are added later, but it really depends. This discussion is moot anyway since he doesn't have any identity columns. :o)
>>>>>>
>>>>>>I posted a link for him, but I also like this description:
>>>>>>
>>>>>>http://www.dotnetjunkies.ddj.com/Article/86F0988E-FED4-414F-BA2E-D01D953C11BE.dcik
>>>>>>
>>>>>>and this:
>>>>>>
>>>>>>http://blog.sqlauthority.com/2007/03/25/sql-server-identity-vs-scope_identity-vs-ident_current-retrieve-last-inserted-identity-of-record/
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>>If I remember correctly, @@IDENTITY doesn't apply to GUIDs, right? I am using uniqueidentifiers....
>>>>>>>>
>>>>>>>
>>>>>>>No, it doesn't apply. You can create new GUID with NewID()
>>>>>>>
>>>>>>>Also it's much better and safer to use SCOPE_IDENTITY() to get the newly created ID.
>>>>>>>
>>>>>>>>>We have an identity column on every table and use @@IDENTITY to check inserts:
>>>>>>>>>
>>>>>>>>>http://www.kamath.com/tutorials/tut007_identity.asp
>>>>>>>>>
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform