Best method to copy a file to the SQL Server machine

sqlbulkcopy sqlclr sql-server

Question

I am looking into copying a file from the client computer to the server computer. One path I've looked into was creating a CLR method which accepts a stream as input. Another suggestion I've had is to use the BCP utility, though I have been unsuccessful in finding any examples which this was done using BCP.

Is it possible to pass a blob to BCP and import to a table, or would there be more steps involved to make this work? Which method would be best for a file copy functionality?

Accepted Answer

You can BCP blobs in and out of the database. Also, I found a reference to scripts for importing and exporting files as blobs which might be helpful.




Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why