Results 1 to 2 of 2

Thread: store file prirefix with date value.

  1. #1
    Join Date
    Nov 2002
    Posts
    231

    store file prirefix with date value.

    Hi,
    I need to export data from sql server into flat file. The file sould be generated with current date and table anem.

    for example yyyymmddhhmmsstablename.txt.

    Do you have any solution for this.
    Thanks,

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    I suppose you want to automate it. You can write a T-SQL Script to get filename with current date time and generate a xp_cmdshell command with bcp out to the file name and run with EXEC.

    exec (@your_xp_cmdshell_bcp_out)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •