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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Insert" trigger to insert muliple lines into 2nd table 1

Status
Not open for further replies.

jtarry

IS-IT--Management
Mar 10, 2010
22
GB
I have a table which contains a quantity value (say 3)

table 1
Part Qty
AAA 3

I want to insert into table 2 via a trigger

Part Value
AAA 1
AAA 2
AAA 3

thanks
 
Create A digits table

DigitID
1
2
3
4
5
.....
1000000
Code:
insert int Table2(Part,Value)
Select Part,Digitid As Value
From Table
inner join Digits
on qty <=Digitid
 
By the way you may want to look at INSTEAD OF triggers

djj
The Lord is My Shepard (Psalm 23) - I need someone to lead me!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top