Click to See Complete Forum and Search --> : Automatically Export Data from SQL


queezer
05-03-2006, 01:02 PM
Hi,

I'm using SQL Query Analyzer and i have a small code that basically returnes my a table with 160.000 rows, which SQL path is, lets imagine "work.dbo.tbl_results". I'd like to put into a code (or similar) that would export this DBO table into a DBF table, is that possible? which line(s) do I have to write?

In alternative I know how to use "DTS wizard Import/Export Data". However is it possible to schedule it? If it was possible, then I wouldn't need any kind of code.

Thank you in advanced!

russell
05-03-2006, 02:13 PM
If yopu already know how to use DTS, then scheduling the dts is a snap. In EM, go to Management / SQL Server Agent / Jobs.

Right-click, select New Job.

Give it a name, go to steps, add a new step.

Choose Operating System Command from the Type pull-down.

In the command text-area type in:
DTSRun /SServerName /NDTSName /E

In the scheduling tab, give it a schedule and you're done.

Make sure that the Service account has permissions on the drive where the dbf lives.