Skip to content Skip to sidebar Skip to footer

Insert Statement With Sub Queries

I am trying to populate some columns in an INSERT statement, but I am trying to use multiple select statements in one INSERT statement. Perhaps this is wrong. Not sure. I am work

Solution 1:

Use this Insert syntax

INSERT INTO ADVNET.dbo.KenCatItemTest
            (CategoryItemId,ItemId,CategoryId)
SELECT Newid(),itemid,'0FCA508F-7EB5-4C2E-8803-DE688C4126E5'
FROM   janel.dbo.item
WHERE  janel.dbo.item.itemnumber LIKE 'c-%'
       AND listprice > 0 

Post a Comment for "Insert Statement With Sub Queries"