>
We're using SELECT @@IDENTITY right after the statement, but we use this only on the tables that don't have triggers. I don't like this solution much, but I don't see a better alternative. IDENT_CURRENT has its own problems. >
>
>Out of curiosity (and maybe you answered this in another message and I missed it)....why aren't you using SCOPE_IDENTITY?
>
>Most of the environments I've been in, IDENT_CURRENT would not have been practical at all, for the reasons you stated.
How do you use scope_identity with remote views? That is the problem I've been working on and ident_current seems to be the solution there as there is a VFP transaction wrapped around this and I think there is a lock. In any case while I am in the VFP transaction SSMS cannot get SCOPE_IDENTITY or query the table or much of anything else. I am sending tableupdate and then immediately doing SPT to get IDENT_CURRENT('tablename')
If try to get SCOPE_IDENTITY in the same scenario it is null.
Charles Hankey
Though a good deal is too strange to be believed, nothing is too strange to have happened.
- Thomas Hardy
Half the harm that is done in this world is due to people who want to feel important. They don't mean to do harm-- but the harm does not interest them. Or they do not see it, or they justify it because they are absorbed in the endless struggle to think well of themselves.
-- T. S. Eliot
Democracy is two wolves and a sheep voting on what to have for lunch.
Liberty is a well-armed sheep contesting the vote.
- Ben Franklin
Pardon him, Theodotus. He is a barbarian, and thinks that the customs of his tribe and island are the laws of nature.