Hi, I want to pass parameters for triggers. Is this possible? if so please give me code how to pass parameters for trigger/ Thanking You, Lalitha.C
no it is not possible to pass parameter to a trigger. pse post your requirement, there may be other ways to address your problem Madhu
In triggers, you can get to the data in the affected rows, as it was before and after the event, through the deleted and inserted conceptual tables. One restriction: you cannot refer to columns of TEXT, NTEXT and other 'large' types. One example is a way to set a 'default for an update', like to automatically change the LastUpdated column on an inserted or updated row: CREATE TRIGGER MyTrigger ON dbo.MyTable FOR INSERT, UPDATE AS UPDATE t SET t.LastUpdated = GETDATE() FROM dbo.MyTable t INNER JOIN inserted i ON t.keycolumn = i.keycolumn GO For inserts, you only have the inserted snapshot. For updates, you have both the inserted and deleted snapshots. For deletes, you only have the deleted snapshot. If the update or delete is caused by a cascading relationship from a parent table, then the corresponding snapshot is empty.
Care to explain what you are trying to achieve? Probably there is another way. -- Frank Kalis Moderator Microsoft SQL Server MVP Webmaster:http://www.insidesql.de
Hi, Thank you to all for u r time, i faced this question in interview. so just i want to know the answer. Thanking you, Lalitha.C
Sounds like a trick question [<img src='/community/emoticons/emotion-2.gif' alt='' />]<br /><br /><hr noshade size="1"><br /><font color="blue"><font size="1"><i>KH</i></font id="size1"></font id="blue">
What was your answer? -- Frank Kalis Moderator Microsoft SQL Server MVP Webmaster:http://www.insidesql.de