helo guys,
can someone send me the script/procedure in performing bcp on ms sql 2000? pls help me, i badly need it.. thank u so much!:)
Printable View
helo guys,
can someone send me the script/procedure in performing bcp on ms sql 2000? pls help me, i badly need it.. thank u so much!:)
You can find sample code in books online.
bcp YourDatabase..YourTargetTable in c:\YourDataFilePath -c -T -SYourServerName
bcp YourDatabase..YourSourceTable out c:\YourOutputFilePath -c -T -SYourServerName
These are just basic examples for importing/exporting a basic tab-delimited text file. Like rmaio said, look into Books Online for further explanation, or type bcp -? from the command line.
What if I have another instance eg. Server\instance_name? because the reply was "ct_connect(): directory service layer: internal directory control layer error: Requested server name not found."
What is the script for this?:)
thanks
You specify sql instance with -S option like -S Server\instance_name.
you could also use Ip address, port number if you know the port number of your named instance..
bcp "Select top 10 * from sys.sysobjects" queryout c:\a123.txt -c -Stcp:1.1.1.2,7001 -T