October 21, 2011 at 10:46 am
can i do a bcp a flat file from unix to sql server 2008 version ?
October 21, 2011 at 10:47 am
bcp.exe requires a MS operating system....so you can't call bcp.exe from a unix operating system....
but you can bcp a FILE into or out of a shared directory that exists on a Unix machine ...if it is properly shared ont he network...to or from any SQL server...is that the question?
you can also of course process the file on the machine that runs bcp.exe...just copying it locally.
Lowell
October 23, 2011 at 6:03 am
"but you can bcp a FILE into or out of a shared directory that exists on a Unix machine..."
- Thats what i am looking for. If say I have a file in shared directory in UNIX then can I bcp it into a table in sql server 2008 ? If yes, how ?
October 23, 2011 at 9:24 am
The same way that you'd do it for any other well formed file except, IIRC, UNIX uses only the "NewLine" character ( \ N) instead of the "Carriage Return/Line Feed" pair which is what BULK INSERT and BCP default to. Obviously, you'd need to make that change for the row terminator.
Have you ever used BCP or BULK INSERT for anything else, before?
--Jeff Moden
Change is inevitable... Change for the better is not.
October 24, 2011 at 7:03 am
I've done this with the dreaded xp_cmdshell driving putty's ssh and scp, putty is so good at running unix shell scripts and copying files, I've pretty much decided that samba is overkill.
October 24, 2011 at 11:02 am
patrickmcginnis59 (10/24/2011)
...dreaded xp_cmdshell...
Heh... "dreaded". I love xp_CmdShell. 🙂
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply