-
OSQL Query Output
Hi All,
The command showed below provides the output shown:
set @cmd = 'osql -S bcgsql1\bcgsqldev -U checkdb -P checkdb -q "set nocount on; select errorlogdesc from ##errors where datediff(dd,errorlogdatetime,getdate()) = 1 and errorlogdesc like ''%Error:%''" -h-1 -w 900 -o J:\Scripts\TestStuff\ErrorLogMsg.txt'
Here is the output:
Error: 17883, Severity: 1, State: 0
Error: 17883, Severity: 1, State: 0
I need to remove the space between the two lines so I set the -w parameter to 900 but that didn't fix it. Any idea how I can accomplish this?
Thanks
-
Did you try RTRIM
set @cmd = 'osql -S bcgsql1\bcgsqldev -U checkdb -P checkdb -q "set nocount on; select RTRIM(errorlogdesc) from ##errors where datediff(dd,errorlogdatetime,getdate()) = 1 and errorlogdesc like ''%Error:%''" -h-1 -w 900 -o J:\Scripts\TestStuff\ErrorLogMsg.txt'
-
Thank you very much. It worked.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|