LLI Wiki — My Digital Knowledge Base

SQL Server: export a binary column to a file with bcp

Extract a document stored in a binary column to a file with bcp queryout.

bcp can extract a binary column (Word document, PDF...) from a SQL Server table to a file, using queryout.

bcp "select document_binary_data from database where id = 12345" queryout "c:\filename.doc" -S server -U username -P '<PASSWORD>'

Explanation

Notes

Mastodon LLIMastodon SocialFosstodon