Search

Friday, April 12, 2013

Happy New year from TSQL

In Query Analyser, set the result mode to Text (Press CTRL+T), execute the following code and see the result.

set nocount on
select
        space(total-len(replicate(char(characters),no)))+ replicate(char(characters),no*2-1)
from
        (
                select top 10 row_number() over (order by name) as no, 17 as total, 210 as characters from sysobjects
        )
as t
union all
select space(14)+replicate(char(124),5)
union all
select space(10)+cast(0x4861707079204E65772079656172 as varchar(100))

No comments:

Post a Comment