Monday, February 20, 2012

isql query output issue

Hi
I am planning to get a report out from isql using command
c:\> isql -Usa -P -d master -i c:\l.sql -o c:\op.lst
c:\> type l.sql
select * from sysobjects;
In op.lst I see 3 blank lines for every line of the output. How to avoid this.
I tried by creating a job to avoid this but there I found the first line of
the output says this
Job 'TSQL_Job_1' : Step 1, 'Step 1' : Began Executing 2005-02-14 14:54:16
---------
Please share with me how to avoid this unncessary data in report.
Thanks
MangeshHi
Thee are 3 blank lines, but that is the spacing for the column 'name'. It is
of datatype sysname, char(128).
Regards
Mike
"Mangesh Deshpande" wrote:
> Hi
> I am planning to get a report out from isql using command
> c:\> isql -Usa -P -d master -i c:\l.sql -o c:\op.lst
> c:\> type l.sql
> select * from sysobjects;
> In op.lst I see 3 blank lines for every line of the output. How to avoid this.
> I tried by creating a job to avoid this but there I found the first line of
> the output says this
>
> Job 'TSQL_Job_1' : Step 1, 'Step 1' : Began Executing 2005-02-14 14:54:16
>
>
> ---------
>
> Please share with me how to avoid this unncessary data in report.
> Thanks
> Mangesh|||Hi
Thanks for the reply. How do we get rid of this space. Is there a way to
this?
"Mangesh Deshpande" wrote:
> Hi
> I am planning to get a report out from isql using command
> c:\> isql -Usa -P -d master -i c:\l.sql -o c:\op.lst
> c:\> type l.sql
> select * from sysobjects;
> In op.lst I see 3 blank lines for every line of the output. How to avoid this.
> I tried by creating a job to avoid this but there I found the first line of
> the output says this
>
> Job 'TSQL_Job_1' : Step 1, 'Step 1' : Began Executing 2005-02-14 14:54:16
>
>
> ---------
>
> Please share with me how to avoid this unncessary data in report.
> Thanks
> Mangesh|||Hi
Don't use SELECT *, it is a bad practice. Rather specify each column.
RTRIM will trim trailing spaces.
SELECT RTRIM([Name]) AS MyName, ........
Regards
--
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
IM: mike@.epprecht.net
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Mangesh Deshpande" <MangeshDeshpande@.discussions.microsoft.com> wrote in
message news:AA4199DE-C15A-4507-BB15-C1BD1D835F3B@.microsoft.com...
> Hi
> Thanks for the reply. How do we get rid of this space. Is there a way to
> this?
> "Mangesh Deshpande" wrote:
> > Hi
> >
> > I am planning to get a report out from isql using command
> > c:\> isql -Usa -P -d master -i c:\l.sql -o c:\op.lst
> > c:\> type l.sql
> > select * from sysobjects;
> >
> > In op.lst I see 3 blank lines for every line of the output. How to avoid
this.
> >
> > I tried by creating a job to avoid this but there I found the first line
of
> > the output says this
> >
> >
> > Job 'TSQL_Job_1' : Step 1, 'Step 1' : Began Executing 2005-02-14
14:54:16
> >
> >
> >
> >
> ----
----
---
> >
> >
> > Please share with me how to avoid this unncessary data in report.
> >
> > Thanks
> > Mangesh

No comments:

Post a Comment