April 29, 2009 at 4:36 am
Hi Guys,
I love this Forum really good especially for a Learner like me.
This is important and I need a quick solution. Pls note I am working on SQL Server 2000.
I have a SQL table with 2M rows which we are migrating to SAP system but due to limitation in SAP which accepts text files with only 9999 rows.
So I want an automated process which will loop through a SQL table pick the Top 9999 and dump it on a text file in a network and then loop the table again to pick the next 9999 and so on until the source exhaust.
I have created a DTS Package to assist in this where created a transformation with source and destination (text file) but I am having issues in looping this process. Do i need a VB script to do this? Any one one please suggest?
my query is:
Select top 9999 Lotnumber, AutoNum, Itemnumber
from dbo.MigrationGas
where Status is null
Order by AutoNum
Then do an Update query with Status = 1 for the one already selected but what should be my query:
Thanks in Advance
Arun
April 29, 2009 at 10:55 pm
It would be a whole lot easier if you could use xp_CmdShell and BCP in a T-SQL loop. Are you allowed to use xp_CmdShell?
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply