The first table I want to move the Product.ProductName
column into the second table called Inventory.ProductName
but delete all the duplicate entries. This I can do, but when I insert these distinct values into Inventory.ProductName
, it creates rows for them instead of associating them with the correct ProductID
. Can't wrap my head around this one. Here's what I tried.
insert into dbo.Inventory (ProductName)
select distinct Product.ProductName
from dbo.Product
inner join dbo.Inventory on (Product.Name = Inventory.ProductID)