inserting into a db, from multiple tables
I have an insert SP as below
however i would like to combine 2 or more table to insert into the accounting table above to augument for the purchaseID and username.
insert into accounting (item, price, quantity, purchaseID, username)
select item1, price1, quantity1 from Accounting where userID = @user
e.g. something like this;
how do i go about this correctly ?
insert into dbo.accounting (item, price, quantity, purchaseID, username)
select item1, price1, quantity1 from dbo.Accounting where userID = @user , dbo.users purchaseID, username INNER JOIN dbo.Users ON dbo.accounting.username = dbo.Users.username