December 8, 2006 at 8:43 am
hello all,
i am having problem in exporting data into a flat file using sql enterprise manager - data transformation services.
i have 95 million records and i need only records within 35 million to 70 million,
can any one help me out in solving this problem.
thanks,
Samee.
December 8, 2006 at 8:58 am
You can use a command promt and bcp.
bcp "select * from myTable where foo between 35 million and 70 million" queryout c:\myfile.txt -c -t; -T
(you get the picture)
There's more info in BOL on bcp, which switches it uses etc...
bcp is among the fastest way to get data out to a file.
/Kenneth
December 8, 2006 at 9:05 am
Kenneth. but, i am totally a newbie to this sql world is it possible for you to tell me in detail how to procede with the query u have given above, i am trying the export the records from a sql database using DTS of sql enterprise manager.
Thank you,
samee
December 8, 2006 at 9:50 am
you just run the command he gave you replacing "mytable" with the name of your table and "foo" with the column name that you need to filter your records on
December 8, 2006 at 10:05 am
i am sorry , i should have made that clear before.. i just know how many records are there, but there is no index column as such to select the records i need.
the table has 30 columns and each column has its own date, noting as an index column to select.
December 8, 2006 at 10:46 am
Well then that's just have to be slow. Creating the index would probabely take more than than selecting the data out anyways. And since you won't gain much speed anyways (not enough to justify the create index), I suggest you just start this thing off off hours and let it run.
December 11, 2006 at 7:18 am
For starters... It seems like you don't want all data in your table in the file...?
If that is the case, what do you want to use to select the rows you want?
Some date perhaps? Then, what is the name of the column that holds those dates, and between which dates do you want to end up in your file?
/Kenneth
Viewing 7 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply