We uploaded all products to the website but forgot to create and assign a distributor. We now created the distributor but how do we assign this distributor to all products?
Can somebody help with a SQL query?
Thanks!
We uploaded all products to the website but forgot to create and assign a distributor. We now created the distributor but how do we assign this distributor to all products?
Can somebody help with a SQL query?
Thanks!
C#/VB.NET Code:
INSERT INTO ProductDistributor (ProductID, DistributorID)
SELECT ProductID, [INSERT DistributorID HERE WITHOUT SQUARE BRACKETS] from dbo.Product;
(Insert obligatory comment about how you should test this before using on a live server - make half a dozen backups, test the backups & pay someone a fortune to verify the query & guarantee it will work)
TTFN
BFG
So, if the Distirbutor ID number is 1, this should be the query:
INSERT INTO ProductDistributor (ProductID, DistributorID)
SELECT ProductID, 1 from dbo.Product;
Is this correct?
Thanks a lot!