dbTalk Databases Forums  

export from Sql Server table to delimited text ";"

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss export from Sql Server table to delimited text ";" in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
sal21
 
Posts: n/a

Default export from Sql Server table to delimited text ";" - 07-29-2010 , 12:01 PM






Please fast way export from Sql Server table to delimited text ";"
with ado and vb6.
Tks

Reply With Quote
  #2  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: export from Sql Server table to delimited text ";" - 07-29-2010 , 03:37 PM






sal21 (gss.italy (AT) iol (DOT) it) writes:
Quote:
Please fast way export from Sql Server table to delimited text ";"
with ado and vb6.
You can use BCP:

bcp db.dbo.tbl out file.txt -c -t; -T -S Server

First argument is table name in three-part notations.

Second argument is the direction.

Third argument is the filename.

-c means that you want character output, ANSI format. Use -w if you want a
Unicode file.

-t; specifies the field delimiter.

-T specifies Windows authentication. Use -U and -P for SQL authentication.

Note that BCP must be installed on the client machine. If this is not
feasible, the simplest may be to just get the recordset and format it in
ADO. There is an API for bulk copy, but it's ODBC, and not accessible
directly from VB6.

--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.