how create job to export table to csv

  • hey .

    i want to create job that make table export to csv.

    i know how do to this in gui only

    thanks

  • Can you elaborate a little bit further on this, i.e. source details, destination details, limitations etc.?

    Are you familiar with bcp?

    😎

  • Eirikur Eiriksson (8/22/2016)


    Can you elaborate a little bit further on this, i.e. source details, destination details, limitations etc.?

    Are you familiar with bcp?

    😎

    i have local instance .

    i want to take export of one talbe from db to csv file . and after this to send mail whit this csv

  • Is this a one-off or do you want to do this regularly, i.e. as a scheduled job? There are quite few options, bcp, sqlcmd, SSIS etc., please let us know the full details for the best advice.

    😎

  • Eirikur Eiriksson (8/22/2016)


    Is this a one-off or do you want to do this regularly, i.e. as a scheduled job? There are quite few options, bcp, sqlcmd, SSIS etc., please let us know the full details for the best advice.

    😎

    i want sched job

  • Easiest way is to use SSMS -> Export Data and Save as SSIS package, then schedule the execution of the package.

    😎

  • Eirikur Eiriksson (8/22/2016)


    Is this a one-off or do you want to do this regularly, i.e. as a scheduled job? There are quite few options, bcp, sqlcmd, SSIS etc., please let us know the full details for the best advice.

    😎

    i get this error

    when i run

  • RESOLVED -

    I do this

    sqlcmd -S myServer -d myDB -E -o "MyData.txt" ^

    -Q "select bar from foo" ^

    -W -w 999 -s","

  • liorvikel (8/22/2016)


    RESOLVED -

    I do this

    sqlcmd -S myServer -d myDB -E -o "MyData.txt" ^

    -Q "select bar from foo" ^

    -W -w 999 -s","

    Good stuff and well done!

    😎

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply