Cookbook/Bcp

From Kx Wiki
Jump to: navigation, search

The wiki is moving to a new format and this page is no longer maintained. You can find the new page at code.kx.com/q/cookbook/bcp/.

The wiki will remain in place until the migration is complete. If you prefer the wiki to the new format, please tell the Librarian why.

Loading and Exporting with bcp

kdb+ does support bcp using the text format

bcp out is

`t.bcp 0:"\t"0:value flip t  / remove column headings

bcp in is:

flip cols!("types";"\t")0:`t.bcp /add headings

pumping data out of kdb+ and inserting it into SQLserver

create the table in SQLserver if it doesn't already exist (use c/odbc.k for that)

once the table exists in SQLserver:

`t.bcp 0:"\t"0:value flip t
\bcp t in t.bcp -c -T
Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox