Link to home
Start Free TrialLog in
Avatar of Pete_Burke
Pete_BurkeFlag for United Kingdom of Great Britain and Northern Ireland

asked on

OSQL data formating problem

OSQL - problem a line break is occuring in the output.

In certain records line breaks are introduced into the output while using osql
The data in the database is free from line breaks and carriage returns and all other non alphanumeric characters.

I've changed the "maximum characters per column" in query analyser to 8000 and tried increasing the dos window size to 1000. But that doesn't work.

If I use query analyser with results to file the data output is fine.

I'm using SQL server 2000

The OSQL is :-
osql -S ServerName -d DatabaseName -E -w1200 -Q DatabaseName.dbo.StoredProcedureName -o C:\OutFile.csv

The stored procedure (StoredProcedureName) queries various tables and uses a cursor with print to output the data as comma separated variables. This output is 910 characters long including the commas  
SOLUTION
Avatar of nmcdermaid
nmcdermaid

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Pete_Burke

ASKER

points awarded