Pages
Home
GP
AX
SQL Server
Downloads
Partners
Sep 6, 2011
Posted by
Venugopal G A
@
11:06 PM
Assign All Items to a given Vendor
---------------------------------------------------------------- -- Assign All Items to a all Vendors -- Code by Venugopal G A -- mail me for any queries venuasg@gmail.com / venuasg@yahoo.com ---------------------------------------------------------------- DECLARE @VENDORID VARCHAR(30) DECLARE @ITEM VARCHAR(100) DECLARE @ITEMDESC VARCHAR(100) DECLARE VENDOR CURSOR FOR SELECT VENDORID FROM PM00200 OPEN VENDOR FETCH NEXT FROM VENDOR INTO @VENDORID WHILE (@@fetch_status <> -1) BEGIN 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 FETCH NEXT FROM VENDOR INTO @VENDORID END DEALLOCATE VENDOR
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment