Skip to content Skip to sidebar Skip to footer

Bcp Utility Write To Remote Server?

According to some recommendations i use bcp Utility to write SQL server Table to .cvs file so i could later transfer the data to informix table with the same structure . My SQLSer

Solution 1:

Question 1: Writing from a remote server

I assume you meant to say "from" not "to". Specify the server name in form ServerName\InstanceName instead of using @@servername, you will need to have permissions to access the other server (since you are using a trusted connection -T)

Question 2: How to add parameters to the BCP statement

BCP is a command line utility not part of Transact-SQL. You can't add parameters. You can format the command line executed. You'll have to make your parameters @date and @empNum strings concatenate them with the rest of the SQL string for the command line

Question 3: Wrong characters in output

Instead of -c use -w to output Unicode characters

Question 4: Pipe not working

A common problem with BCP, simply quote the pipe like this -t"|" to make that the record separator

Post a Comment for "Bcp Utility Write To Remote Server?"