How to supress blank lines returned by several consecutives SELECTs

How to supress blank lines returned by several consecutives SELECTs

Post by Peter Raue » Fri, 28 Sep 2001 02:27:57



When  I execute the following command in the SQL Server 2000 (with the
option "Tools\Options\Results\Default result target" set to "Results to
text"):

SELECT 'Private Sub Class_Initialize()'
SELECT '    Call ClearVars'
SELECT 'End Sub'

the result is:

Private Sub Class_Initialize()

    Call ClearVars

End Sub

In order to supress the blank lines between the results, I changed the
command to:

SELECT 'Private Sub Class_Initialize()' + '
' + '    Call ClearVars' + '
' + 'End Sub'

so the result was:

Private Sub Class_Initialize()
    Call ClearVars
End Sub

Is there another solution (any SET options ?) that supress these blank lines
without making changes to my stored procedures ?

thanks,
Peter

P.S. This does not occurs when using SQL Server 6.5.

 
 
 

How to supress blank lines returned by several consecutives SELECTs

Post by Roy Harve » Fri, 28 Sep 2001 02:30:20


Peter,

I have had some success using UNION ALL in this situation, which turns
it all into a single result set.  The down side is that there is no
guarantee that the "rows" will return in the correct order.  They
always have for me, and I don't know why they would not, but it is not
guaranteed.

SELECT 'Private Sub Class_Initialize()'
UNION ALL
SELECT '    Call ClearVars'
UNION ALL
SELECT 'End Sub'

Roy


>When  I execute the following command in the SQL Server 2000 (with the
>option "Tools\Options\Results\Default result target" set to "Results to
>text"):

>SELECT 'Private Sub Class_Initialize()'
>SELECT '    Call ClearVars'
>SELECT 'End Sub'

>the result is:

>Private Sub Class_Initialize()

>    Call ClearVars

>End Sub

>In order to supress the blank lines between the results, I changed the
>command to:

>SELECT 'Private Sub Class_Initialize()' + '
>' + '    Call ClearVars' + '
>' + 'End Sub'

>so the result was:

>Private Sub Class_Initialize()
>    Call ClearVars
>End Sub

>Is there another solution (any SET options ?) that supress these blank lines
>without making changes to my stored procedures ?

>thanks,
>Peter

>P.S. This does not occurs when using SQL Server 6.5.


 
 
 

How to supress blank lines returned by several consecutives SELECTs

Post by SUNI » Fri, 28 Sep 2001 04:27:04


May be this help.
SELECT 'Private Sub Class_Initialize()'+char(10),'    Call
ClearVars'+char(10),'End Sub'


Quote:

> When  I execute the following command in the SQL Server 2000 (with the
> option "Tools\Options\Results\Default result target" set to "Results to
> text"):

> SELECT 'Private Sub Class_Initialize()'
> SELECT '    Call ClearVars'
> SELECT 'End Sub'

> the result is:

> Private Sub Class_Initialize()

>     Call ClearVars

> End Sub

> In order to supress the blank lines between the results, I changed the
> command to:

> SELECT 'Private Sub Class_Initialize()' + '
> ' + '    Call ClearVars' + '
> ' + 'End Sub'

> so the result was:

> Private Sub Class_Initialize()
>     Call ClearVars
> End Sub

> Is there another solution (any SET options ?) that supress these blank
lines
> without making changes to my stored procedures ?

> thanks,
> Peter

> P.S. This does not occurs when using SQL Server 6.5.