April 29, 2009 at 5:27 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 5:36 am
You say you are using SQL 2000, but this is in the SQL 2005 forum, so you have a copy of SSIS avalaible?
if so, this could be acheived by using a for-each container, you could create a lookup table that contains the the row numbers that you want to split on, then use the for-each to loop through this and run a dataflow that creates a flat-file with the name based upon the rownumbers.
If you do not have 2k5 and SSIS, then i am not sure if this is possible with DTS as i have not used that for years..
April 29, 2009 at 5:45 am
If 2000 check out http://www.sqldts.com
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply