Export to asci or ansi text file on 2005

  • HI i have a select statement that i currently run as a weekly job that exports the results to a txt file. Unfortunately it exports it as unicode and this type of file isn't very usable by our mainframe programers.

    How can i export or save this file as a normal asci or ansi text file.

    I've tried using bcp with the xp_cmdshell with the queryout but come back with "Error = [Microsoft][SQL Native Client]Named Pipes Provider: Could not open a connection to SQL Server [2]".

    Any help will be appreciated!

    Thanks,

    WEZ

  • I figured out a way that allows me to have more control and isn't all that difficult

    1. Create a SSIS export file

    - right click any DB go to Tasks-Export Data

    - provide credentials and select database with table, sp, or view you want to export from

    - on destination select "Flat File Destination" and then the formats you want

    - you can then go through the remain pages as normal and at the Save and Execute package select "Save SSIS Package" and in the "Package protection level" select "Rely on server storage and roles for access control"

    2. After i save file i created a job to run periodically

    - Created a step that is type "SQL Server Integration Services Package"

    - Under "Package" click on the elipse and select the SSIS package you just created

    - finish job and run or schedule it to run when needed

    Hopefully this helps someone else out down the road since you can specify if you want unicode or not.

Viewing 2 posts - 1 through 1 (of 1 total)

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