Export Data tables to Excel file

  • Hi,

    I'm new on this forum, and i would like to know how to make montly periodic backup of my tables on an excel file including the day of backup?

    I tried using DTS but it generates always the same file name, so it works the first time and then fails for others.

    Thanks

     

     

  • Try using an ActiveX script in DTS to create the Excel file and control the name of it there, including the date in the name.

  • Try using DTS Excute SQL Task in order to dump data to excel file or DTS Importor export wizard to dump the tables route.

  • Always export to the same Excel file, and then rename this file with a stored procedure to the name you wish.

  • Thanks for help, but as i'm a sql server novice, who can tell me how to rename an excel file with a stored procedure.

     

  • Use the xp_cmdshell procedure to execute a DOS command. You can find lots of articles about this famous command.

  • Create the DTS package and create variable for the file name.  You can use a stored procdure to run the DTS package, passing the name of the file in.  A good article on how to set that up is here. http://www.databasejournal.com/features/mssql/article.php/1459181

Viewing 7 posts - 1 through 6 (of 6 total)

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