Exporting data from SQL SERVER tables to a new CSV file daily
Hi Experts, Need help..how to pull data from Sql server table to CSV file on a daily basis. I am using DFT, Source as OLEDB source and destination as Flat file. now this flat file I have to create new everyday with date append to the fileName. so, to achieve this what should I need to do. I searched but could not found complete answer at one place. Thanks in advance
September 11th, 2012 6:06am

you can add date in your CSV file every day.. Please check the following link http://sqlserverdownanddirty.blogspot.in/2011/04/including-current-date-in-flat-file.html http://www.mssqltips.com/sqlservertip/1084/dynamic-flat-file-connections-in-sql-server-integration-services/ Let us TRY this | My Blog :: http://quest4gen.blogspot.com/
Free Windows Admin Tool Kit Click here and download it now
September 11th, 2012 6:12am

Hai Noor, 1.You can use dynamic connection string for your flat file connection please refer the follwoing link. http://www.mssqltips.com/sqlservertip/1084/dynamic-flat-file-connections-in-sql-server-integration-services/ 2.Put your package in to a SQL JOb and shedule it to run by daily basis Thanks, Vasantha Prabakaran
September 11th, 2012 6:15am

Hi Thanks for the responses. Now, I am able to create a dynamic flat file with date. There is one field in this format - 9123456789123 but this is coming as 9.12345E+12. Now, how should I expoert it as is i.e. 9123456789123
Free Windows Admin Tool Kit Click here and download it now
September 11th, 2012 7:03am

Set imax=1 in excel connection.Setting this forces columns to be treated as text. Let us TRY this | My Blog :: http://quest4gen.blogspot.com/
September 11th, 2012 7:19am

Where to set this property. My destination file is not Excel it's CSV.
Free Windows Admin Tool Kit Click here and download it now
September 11th, 2012 7:21am

Where to set this property. My destination file is not Excel it's CSV. add this to excel connection string.... OR share your excel connection string.... Let us TRY this | My Blog :: http://quest4gen.blogspot.com/
September 11th, 2012 7:22am

checked the BOLD text below.... and add the same in your excel connection string.. "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\""+ @[MyImport::File_FullName]+"\";Extended Properties=\"Excel 12.0;imax=1;HDR=YES\";" --Let us TRY this | My Blog :: http://quest4gen.blogspot.com/
Free Windows Admin Tool Kit Click here and download it now
September 11th, 2012 7:25am

here's the screen shot of it...
September 11th, 2012 7:30am

open your .csv file with NOTEPAD and then check... as I know by default .csv file opens with excel. let us know... Let us TRY this | My Blog :: http://quest4gen.blogspot.com/
Free Windows Admin Tool Kit Click here and download it now
September 11th, 2012 8:30am

Yes, When I opened it in notepad the field is coming as is now. Thank You.
September 11th, 2012 9:19am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics