Wrap the three inserts into a transaction. SQL Server BOL will give information on how to do it.
>Hello.
>
>I have three tables
>Table1(code c(5)) Holds the last number used, this is not autoincremental
>Table2(code c(5)) because the user can change the last number printed
>Trans1(code1 c(5), code2 c(5), descrip c(30) ...)
>
>How should be the insert code so I can update all three tables at once ?
>
>c.x.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer