osql import inserting carriage returns? 
October 15th, 2008, 05:05 PM
| | | |
I'm trying to run an import of some data that has unix style carriage
returns throughout (ie, 0x0A, or \n). When i use osql to import the
data, it shows up in the SQL Server 2005 database as 0x0D 0x0A or \r
\n.
I do not want this behaviour - the import file is very large and has
ddl at the beginning. Can anyone suggest a more suitable utility or
method for importing this data that will preserve the original
format? Or perhaps my database is not configured correctly?
Thanks,
Bob | 
October 15th, 2008, 05:15 PM
| | | | re: osql import inserting carriage returns?
On Wed, 15 Oct 2008 09:03:57 -0700 (PDT), "bobdurie@gmail.com"
<bobdurie@gmail.comwrote: Quote:
>I'm trying to run an import of some data that has unix style carriage
>returns throughout (ie, 0x0A, or \n). When i use osql to import the
>data, it shows up in the SQL Server 2005 database as 0x0D 0x0A or \r
>\n.
>
>I do not want this behaviour - the import file is very large and has
>ddl at the beginning. Can anyone suggest a more suitable utility or
>method for importing this data that will preserve the original
>format? Or perhaps my database is not configured correctly?
| I haven't had to work with that type of data that I can recall, but I
do wonder how you use OSQL to import data. BCP, DTS, SSIS, BULK
INSERT sure, but not OSQL, which is for executing SQL commands.
Roy Harvey
Beacon Falls, CT | 
October 15th, 2008, 05:15 PM
| | | | re: osql import inserting carriage returns? | 
October 15th, 2008, 05:25 PM
| | | | re: osql import inserting carriage returns?
On Oct 15, 12:10*pm, "Roy Harvey (SQL Server MVP)"
<roy_har...@snet.netwrote: Quote:
On Wed, 15 Oct 2008 09:03:57 -0700 (PDT), "bobdu...@gmail.com"
>
<bobdu...@gmail.comwrote: Quote:
I'm trying to run an import of some data that has unix style carriage
returns throughout (ie, 0x0A, or \n). *When i use osql to import the
data, it shows up in the SQL Server 2005 database as 0x0D 0x0A or \r
\n.
| > Quote:
I do not want this behaviour - the import file is very large and has
ddl at the beginning. *Can anyone suggest a more suitable utility or
method for importing this data that will preserve the original
format? *Or perhaps my database is not configured correctly?
| >
I haven't had to work with that type of data that I can recall, but I
do wonder how you use OSQL to import data. *BCP, DTS, SSIS, BULK
INSERT sure, but not OSQL, which is for executing SQL commands.
>
Roy Harvey
Beacon Falls, CT
|
Hi Roy,
The .sql file has all the "create table" and "insert into" commands.
I just run the command like this:
c:\osql -U sa -P blahblah -d mydb -i C:\myimportfile.sql
All the data imports fine, except the simply 0x0A's in the data - they
appear in the db as 0D0A's.
If i look at the .sql file before import in a hexeditor there is
clearly no 0D's in the data itself.
Bob | 
October 15th, 2008, 07:15 PM
| | | | re: osql import inserting carriage returns?
On Oct 15, 12:14*pm, Plamen Ratchev <Pla...@SQLStudio.comwrote: Hi Plamen,
BCP does look like a great tool, but my output format of ".sql" with
complete INSERT and CREATE TABLE statements doesn't seem like its
compatible with bcp. Please correct me if i'm wrong.
Thanks,
Bob | 
October 15th, 2008, 07:25 PM
| | | | re: osql import inserting carriage returns?
On Wed, 15 Oct 2008 11:11:29 -0700 (PDT), "bobdurie@gmail.com"
<bobdurie@gmail.comwrote: Quote:
>BCP does look like a great tool, but my output format of ".sql" with
>complete INSERT and CREATE TABLE statements doesn't seem like its
>compatible with bcp. Please correct me if i'm wrong.
| No, BCP won't do that. Of course Plamen responded before it was clear
what you were doing.
Roy Harvey
Beacon Falls, CT |  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 225,662 network members.
|