Pages
Home
GP
AX
SQL Server
Downloads
Partners
Apr 8, 2011
SQL Script to assign all Items to a given Vendors
Posted by
Venugopal G A
@
10:41 AM
Assign All Items to a given Vendor
-------------------------------------------------------- -- Assign All Items to a given Vendor -- Code by Venugopal G A -- mail me for any queries venuasg@gmail.com -- Change the vendor variable to your vendorid -------------------------------------------------------- DECLARE @VENDORID VARCHAR(15) DECLARE @ITEM VARCHAR(100) DECLARE @ITEMDESC VARCHAR(100) SET @VENDORID = 'ACETRAVE0001' DECLARE ITEMMASTER CURSOR FOR SELECT ITEMNMBR, ITEMDESC FROM IV00101 OPEN ITEMMASTER FETCH NEXT FROM ITEMMASTER INTO @ITEM, @ITEMDESC WHILE (@@fetch_status <> -1) BEGIN INSERT INTO [IV00103] ([ITEMNMBR],[VENDORID],[ITMVNDTY],[VNDITNUM],[VNDITDSC]) VALUES(@ITEM,@VENDORID,1,@ITEM,@ITEMDESC) FETCH NEXT FROM ITEMMASTER INTO @ITEM, @ITEMDESC END DEALLOCATE ITEMMASTER
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment