Trigger – INSERT SELECT | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Trigger – INSERT SELECT

Dear friends, i need to know how i have to do to execute a trigger ‘n’ times when a execute a command line like this: insert table1
select * from table2 I this kind of command line, the table1 trigger execute just one time, but insert ‘n’ rows in table1 table. When i execute the following command, the table1 trigger executes ‘n’ times:

while @i<[email protected]
begin
insert table1(field1,field2) values(value1,value2)
select @[email protected]+1
end

Thank’s
You want to fire a trigger ‘n’ times when you insert a single row into trigger table?
MohammedU.
Microsoft SQL Server MVP
Moderator
SQL-Server-Performance.com All postings are provided “AS IS” with no warranties for accuracy.

Similar tohttp://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=22747 Madhivanan Failing to plan is Planning to fail
THis thread is locked as you have further clues from Frank over there.
Satya SKJ
Microsoft SQL Server MVP
Writer, Contributing Editor & Moderator
http://www.SQL-Server-Performance.Com
@http://www.askasqlguru.com/ This posting is provided AS IS with no rights for the sake of knowledge sharing. Knowledge is of two kinds. We know a subject ourselves or we know where we can find information on it.
]]>