Re: [GENERAL] Importing directly from BCP files

2015-11-16 Thread Adrian Klaver
On 11/16/2015 05:47 PM, Tim Uckun wrote: I am going to ask them that but there are tons of legacy files which might need to be dealt with again in the future so I was hoping to use them directly. Seems it comes down to who is going to have to do the dealing, you or the folks supplying the file

Re: [GENERAL] Importing directly from BCP files

2015-11-16 Thread Tim Uckun
I am going to ask them that but there are tons of legacy files which might need to be dealt with again in the future so I was hoping to use them directly.

Re: [GENERAL] Importing directly from BCP files

2015-11-16 Thread Adrian Klaver
On 11/16/2015 04:25 PM, Tim Uckun wrote: the binary form of the BCP file output is undocumented. So if all the BCP files you have are the binary(native) version you are up this creek without a paddle. Ugh. Yes it looks like that's the creek I am on. Thanks Microsoft! So, mov

Re: [GENERAL] Importing directly from BCP files

2015-11-16 Thread Tim Uckun
> > the binary form of the BCP file output is undocumented. So if all the BCP > files you have are the binary(native) version you are up this creek without > a paddle. > > Ugh. Yes it looks like that's the creek I am on. Thanks Microsoft! > So, moving to another creek. It depends on the amount

Re: [GENERAL] Importing directly from BCP files

2015-11-16 Thread Adrian Klaver
On 11/16/2015 12:15 PM, Tim Uckun wrote: On openSuSE 13.2 sudo zypper install freetds-tools Ubuntu 14.04 sudo apt-get install freetds-bin aklaver@killi:~> freebcp -h usage: freebcp [[database_name.]owner.]table_name {in | out} datafile [-m maxerrors] [-f

Re: [GENERAL] Importing directly from BCP files

2015-11-16 Thread Kevin Grittner
On Monday, November 16, 2015 1:15 PM, Tim Uckun wrote: > I don't see any documentation anywhere about the BCP format and > as I said googling for "BCP format" gives a zillion links about > the format files. That's because there is no one, single "BCP format" -- the format of a BCP file is determ

Re: [GENERAL] Importing directly from BCP files

2015-11-16 Thread Tim Uckun
> > > On openSuSE 13.2 > > sudo zypper install freetds-tools > > Ubuntu 14.04 > > sudo apt-get install freetds-bin > > aklaver@killi:~> freebcp -h > usage: freebcp [[database_name.]owner.]table_name {in | out} datafile > [-m maxerrors] [-f formatfile] [-e errfile] > [-F firstrow] [

Re: [GENERAL] Importing directly from BCP files

2015-11-16 Thread Alvaro Herrera
Tim Uckun wrote: > > The bulk import command in PostgreSQL is COPY, so you'll likely want to > > look at http://www.postgresql.org/docs/9.4/static/sql-copy.html > > I need to get them into a shape where copy command can process them first I > think. Maybe transform the format file into something

Re: [GENERAL] Importing directly from BCP files

2015-11-16 Thread Adrian Klaver
On 11/16/2015 11:13 AM, Tim Uckun wrote: I don't see any documentation anywhere about the BCP format and as I said googling for "BCP format" gives a zillion links about the format files. Every project on github just calls out the BCP command but I am on linux and that doesn't help me at all. B

Re: [GENERAL] Importing directly from BCP files

2015-11-16 Thread Tim Uckun
I don't see any documentation anywhere about the BCP format and as I said googling for "BCP format" gives a zillion links about the format files. Every project on github just calls out the BCP command but I am on linux and that doesn't help me at all. Bummer. This is going to be a huge pain to tr

Re: [GENERAL] Importing directly from BCP files

2015-11-16 Thread S McGraw
On 11/15/2015 11:52 PM, Tim Uckun wrote: > > I moved a database from MS Sql Server 2000 to Postgresql a few years > > ago via BCP files. I used a Python script to do some fixup on the > > BCP files to make them importable as CSV files into Postgresql. I > > don't know if quirks I ran into are

Re: [GENERAL] Importing directly from BCP files

2015-11-15 Thread Tim Uckun
> > > I moved a database from MS Sql Server 2000 to Postgresql a few years > ago via BCP files. I used a Python script to do some fixup on the > BCP files to make them importable as CSV files into Postgresql. I > don't know if quirks I ran into are still an issue with newer versions > of Sql Serv

Re: [GENERAL] Importing directly from BCP files

2015-11-15 Thread Tim Uckun
> > > That appears to depend on the -f option > > > I have the format files so that's good. > > Have you tried opening a file in a text editor to see what they look like? > > Yes. It looks like a binary file with lots of non printable ch

Re: [GENERAL] Importing directly from BCP files

2015-11-15 Thread S McGraw
On 11/15/2015 07:31 PM, Tim Uckun wrote: > Does anybody have any documentation on what a BCP file from SQL > server looks like? I have a directory full of BCP files and I would > like to import them into PG. > > Has anybody done anything like this before? I moved a database from MS Sql Server 20

Re: [GENERAL] Importing directly from BCP files

2015-11-15 Thread David Rowley
On 16 November 2015 at 15:31, Tim Uckun wrote: > Does anybody have any documentation on what a BCP file from SQL server > looks like? > That appears to depend on the -f option https://msdn.microsoft.com/en-nz/library/ms162802.aspx There's more details on the format files here https://msdn.micr

[GENERAL] Importing directly from BCP files

2015-11-15 Thread Tim Uckun
Does anybody have any documentation on what a BCP file from SQL server looks like? I have a directory full of BCP files and I would like to import them into PG. Has anybody done anything like this before? Thanks