Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What's teh MSSQL equivalent to "SELECT INTO OUTFILE"?

Status
Not open for further replies.

Guggly

Programmer
Jan 18, 2004
110
US
I want to export a resultset into CSV from MSSQL, is there something that can be used to do this simply? MySQL has the SELECT INTO OUTFILE functionality, but that is causing me errors when I try to run it in MSSQL.

Thanks! -- Mike
 
Look up bcp in the help files, that should do what you want.

Hope this helps,

Alex

A wise man once said
"The only thing normal about database guys is their tables".
 
Okay, but BCP doesn't include column names in the output, as far as I can tell. Is there any way to get around that? Thanks!
 
I'm not sure. If you use a DTS package it will create a worksheet for you and assign column names. Maybe this would be a better option in your case?

Trye the wizard found under tools -->Data Transformation Services --> Export Data, it should do what you want.

A wise man once said
"The only thing normal about database guys is their tables".
 
I got what I needed using the SQL Server Import and Export Wizard. Now the only thing I need to figure out is where the saved SSIS package is stored. I can't seem to locate it anywhere in SSMS. Any help?
 
You can probably find out how to access the package in the help files. Sorry I can't be of more help, but I'm using SQL 2000.

ALex

A wise man once said
"The only thing normal about database guys is their tables".
 
I think I've got it now. Thanks for your help, Alex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top