I need to send data to client in Pipe or comma delimited format. File is too large to open in Excel or wordpad. How can I insert pipes or commas into my query?
Have you looked at using a DTS package for this? You can create a package with three elements, (Source, Destination, and Transformation Task), that will export data based on views, tables, or an SQL statement.
You can then schedule the package to run at regular intervals if you like.
Thank you all for your responses. I like the idea of creating a dts package, mikeyb540, I need a little more help please. I've started creating the package, but I can't figure out how to put in the pipe or comma delimiters. Can you please help.
Or if you are running the query in Query Analyzer (manually), you can select Tools > Options go to Results tab and set where the results go to and in what format.
If you want to create the DTS package using Enterprise Manager and a DTS wizard, do the following steps:
1. In the tree view, expand your server, expand Data Transformation Services, and click Local Packages
2. In the toolbar, click the "Run a Wizard" icon (looks like a magic wand)
3. Expand Data Transformation Services, select DTS Export Wizard, and click OK
4. Click Next on the opening screen
5. Select your data source (Microsoft OLE DB Provider for SQL Server), your server, and your database, then click Next
6. Select your destination (Text File), and enter a file name (full path), then click Next
7. Leave default of "Copy Tables and View from the source database", click Next
8. Select the parameters for the output file, click Next
9. Uncheck "Run Immediately", and check "Save DTS Package" with the default setting of SQL Server, click Next
10. Give the package a useful name, click Next
11. Click finished.
12. Finally, right click the new package and select "Execute Package" to test.
The wizard really does make this type of operation easy.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.