Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE [dbo].[Inventory](
- [ID] [int] IDENTITY(1,1) NOT NULL
- [SerialNo] [nvarchar](50) NOT NULL,
- [Quantity] [decimal](12, 3) NULL)
- CREATE TABLE [dbo].[InventoryDetails](
- [ID] [int] IDENTITY(1,1) NOT NULL,
- [InventoryID] [int] NOT NULL,
- [ProductID] [int] NOT NULL,
- [Quantity] [decimal](10, 3) NOT NULL)
- Update I set Quantity=Sum(ID.Quantity)
- from Inventory I
- Inner Join inserted ID on I.ID=ID.InventoryID
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement