Gurpreet Arora

Gurpreet Arora

  • 227
  • 7.6k
  • 581.7k

Unable to update table rows on the bases of another table

Aug 3 2015 8:37 AM
Hi

I need a help


I create a table
Table 1
(
Id int primary key Identity(1,1) not null,
Name varchar (100),
NoofBoxes int
)


Table 2
(
Boxes_Id int Primary key Idenity(1,1) not null,
Name varchar (100),
)


I want that When I insert value in Table 1 that NoofBoxes is 10 then in Table 2 10 rows has been Inserted ,

I face A problem

when I Update table 1 NoofBoxes from 10 to 8 then I need that 2 rows deleted from table 2 and when I Update table 1 from 10 to 15 then I need 5 more rows in table 2

Answers (2)