I have written the trigger and within the trigger I am calling a stored procedure. Can I use the table names Inserted and Deleted in the stored procedure that is being called by the trigger. Is there any way to pass these if not available there? Bharat, sorry to jump in, but I wanted to take a stab at this:
In SQL 2000, the Inserted and Deleted system tables are only visible inside a trigger. (This has changed in 2005).
You cannot "pass" tables as parameters. If you need the contents of the INSERTED and DELETED tables outside of the trigger, you need to SELECT them into Temporary Tables inside your trigger:
SELECT * INTO #TempInserted FROM Inserted
SELECT * INTO #TempDeleted FROM Deleted
And then you can reference #TempInserted and #TempDeleted in a stored procedure that's called by the trigger. However, there are some potential "gotchas", such as if you're using TEXT fields.
While this can be made to work....if I can ask, why specifically do you need to do this, especially if you're scripting your update triggers. Just curious.
Kevin