Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Understanding triggers/cursors and select

Status
Not open for further replies.

JuanitaC

Programmer
Feb 21, 2001
292
CA
I am creating a trigger based on an existing trigger written by a co-worker. He declares a cursor for the trigger with this syntax:
Code:
DECLARE psCursor SCROLL CURSOR FOR
     SELECT id FROM inserted WHERE id IN (SELECT id FROM inserted)

I am confused by the syntax of the select statement. I don't see how this is different from just plain:
Code:
SELECT id FROM inserted
. My co-worker has been doing this for years and knows that the syntax he has used is important, but can't remember why. If anyone can enlighten me, I would appreciate it.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top