May 5, 2006 at 9:23 pm
I am using INSERT INTO statement to insert set of values into a table which has an identity column.
When I run the statement, it returns the latest identity value.
How can I turn this OFF?
Thanks,
May 5, 2006 at 9:40 pm
I don't believe it's returning the the latest identity value unless someone put a trigger on the table that does so. Check to see if there are any triggers on the table... you might not want to turn off such a trigger because it may mess up what a GUI is expecting.
To temporarily disable a trigger, use the following...
ALTER TABLE tablenamehere DISABLE TRIGGER triggernamehere
To turn it back on, use the following...
ALTER TABLE tablenamehere ENABLE TRIGGER triggernamehere
But, like I said, it might not be a trigger... maybe it's just the rowcount you are seeing... if so, you can turn that off with the following...
SET NOCOUNT ON
--Jeff Moden
Change is inevitable... Change for the better is not.
May 6, 2006 at 3:03 pm
You are Right! I had created a trigger on the table while testing and forgot about it.
Thanks so much.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply