Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 how can use Before Insert > not after

Author  Topic 

jooorj
Posting Yak Master

126 Posts

Posted - 2011-05-06 : 15:15:19
In TRIGER SQL I did not find BEFORE INSERT
but there are only AFTER INSERT>
how can I do that?

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2011-05-06 : 15:16:32
Use INSTEAD OF for before


Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-05-06 : 15:25:49
What are you trying to do? Scenarios requiring instead of triggers are not that common.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

jooorj
Posting Yak Master

126 Posts

Posted - 2011-05-07 : 04:24:52
I want to insert data into Table1 before fire the action of Insert into Table2)
how can do that by a triger on table2

tx
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-05-07 : 04:31:31
Why does it need to be done before?

If you're inserting via a stored procedure, it's probably better to do the 2 inserts there rather than in a trigger.

--
Gail Shaw
SQL Server MVP
Go to Top of Page

jooorj
Posting Yak Master

126 Posts

Posted - 2011-05-07 : 18:59:21
is there any answer?
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-05-07 : 19:18:16
Yes: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=160337
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-05-08 : 05:34:54
quote:
Originally posted by jooorj

is there any answer?



I'm still waiting for answers to my questions

--
Gail Shaw
SQL Server MVP
Go to Top of Page
   

- Advertisement -