Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Browse by Tags · View All
sql_server 217
t-sql 211
tsql 116
sqlserver 96
BRH 78
#SQLServer 66
#TSQL 56
SQL Server 34
function 11
SSMS 9

Archive · View All
August 2007 17
August 2010 8
June 2012 7
June 2011 7
November 2007 7
August 2012 6
May 2012 6
November 2011 6
August 2011 6
October 2011 6

Madhivanan's TSQL Blog

Fun in TSQL - TSQL from TSQL

Dec 5 2011 3:57AM by Madhivanan   

This is just for Fun. The following code is unformatted, unclear and may be confusing. But curious to know the result? Set the result mode of the query window to Text . While you are in Query Window press CONTROL+T and run the following code and see what it returns.

                                                                     
set nocount on select case no when 1 then col when 2 then stuff(stuff(stuff(stuff(col,1,cast(4e1/5 as int),replicate(' ',cast(4e1/5 as int))),cast(2e1-1 as int),3,replicate(' ',3)),cast(sqrt(12+11e2)/3 as int)*3,
5,replicate(' ',5)),cast(5e1-3 as int),cast(2e1-4 as int),replicate(' ',3)) when 3 then stuff(stuff(stuff(stuff(col,1,cast(4e1/5 as int),replicate(' ',cast(4e1/5 as int))),cast(2e1-1 as int),3,replicate(' ',3)),cast(sqrt(12+11e2)/3 as int)*3,4,replicate(' ',4)),cast(5e1-2 as int),cast(2e1-5 as int),replicate(' ',2)) when 4 then stuff(
stuff(stuff(stuff(stuff(col,1,cast(4e1/5 as int),replicate(' ',cast(4e1/5 as int))),cast(2e1-1 as int),3,replicate(' ',3)),28,cast(4e1/5 as int),replicate(' ',cast(4e1/5 as int))),cast(POWER(ISNULL(null,4),3)-3e0-(7*3) as int),3,replicate(' ',3)),cast(5e1-2 as int),cast(2e1-5 as int),replicate(' ',2)
)when 5 then stuff(stuff(stuff(stuff(stuff(col,1,cast(4e1/5 as int),replicate(' ',cast(4e1/5 as int))),cast(2e1-1 as int),3,replicate(' ',3)),28,cast(4e1/5 as int),replicate(' ',cast(4e1/5 as int))),cast(POWER(ISNULL(null,4),3)-3e0-(7*3) as int),3,replicate(' ',3)),cast(5e1-1 as int),cast(2e1-6 as int),replicate(' '
,1))when 6 then stuff(stuff(stuff(stuff(stuff(col,1,cast(sqrt(12+11e2)/3 as int),replicate(' ',cast(sqrt(12+11e2)/3 as int))),cast(2e1-4 as int),6,replicate(' ',6)),cast(sqrt(12+11e2)/3 as int)*3,3,replicate(' ',3)),cast(POWER(ISNULL(null,4),3)-3e0-(7*3) as int),3,replicate(' ',3)),cast(5e1-1 as int),cast(2e1-6 as int),
replicate(' ',1))when 7 then stuff(stuff(stuff(stuff(stuff(col,1,cast(sqrt(12+11e2)/3 as int),replicate(' ',cast(sqrt(12+11e2)/3 as int))),cast(2e1-4 as int),6,replicate(' ',6)),cast(sqrt(12+11e2)/3 as int)*3,3,replicate(' ',3)),cast(POWER(ISNULL(null,4),3)-3e0-(7*3) as int),3,replicate(
' ',3)),cast(5e1-2 as int),cast(2e1-5 as int),replicate(' ',2))when 8 then stuff(stuff(stuff(stuff(stuff(col,1,cast(sqrt(12+11e2)/3 as int),replicate(' ',cast(sqrt(12+11e2)/3 as int))),cast(2e1-4 as int),10,replicate(' ',10)),cast(sqrt(12+11e2)/3 as int)*3,4,replicate(' ',4)),cast(5e1-3 as int),3,replicate(' ',3)),cast(5e1+8 as int),cast(2e1-7 as int),REPLICATE(' '
,cast(2e1-7 as int)))when 9 then stuff(stuff(stuff(stuff(col,1,cast(sqrt(12+11e2)/3 as int),replicate(' ',cast(sqrt(12+11e2)/3 as int))),cast(2e1-4 as int),10,replicate(' ',10)),cast(sqrt(12+11e2)/3 as int)*3,6,replicate(' ',6)),cast(5e1-6 as int),6,replicate(' ',6))when 10 then stuff(stuff(stuff(stuff(col,1,cast(sqrt(12
+11e2)/3 as int),replicate(' ',cast(sqrt(12+11e2)/3 as int))),cast(2e1-4 as int),6,replicate(' ',6)),cast(sqrt(12+11e2)/3 as int)*3,6,replicate(' ',6)),cast(5e1-6 as int),6,replicate(' ',6))	when 11 then stuff(stuff(stuff(stuff(col,1,cast(sqrt(12+11e2)/3 as int),replicate(' ',cast(sqrt(12+11e2)/3 as int))
),cast(2e1-4 as int),6,replicate(' ',6)),cast(sqrt(12+11e2)/3 as int)*3,7,replicate(' ',7)),cast(5e1-5 as int),5,replicate(' ',5))when 12 then col end from(select no,replicate(char(42),ceiling(15e3/215)) as col	from (select top (cast(3e2/25 AS int)) row_number() over (order by name) as no from sys.sysobjects )as t 
) as t

Tags: t-sql, sql_server, sqlserver, tsql, fun, #SQL SERVER,


Madhivanan
3 · 40% · 12958
12 Readers Liked this
Paresh Prajapati Liked this on 12/5/2011 4:49:00 AM
Profile · Blog · Facebook · Twitter
Vishal Gajjar Liked this on 12/8/2011 8:55:00 AM
Profile · Blog
Shivendra Kumar Yadav Liked this on 12/11/2011 11:18:00 PM
Profile
Madhivanan Liked this on 12/5/2011 5:21:00 AM
Profile · Blog · Facebook · Twitter
incrediblearul Liked this on 12/5/2011 7:17:00 AM
Profile · Facebook
kingkong0924 Liked this on 2/12/2012 7:11:00 PM
Profile
Adam Tokarski Liked this on 2/27/2012 5:23:00 AM
Profile
Oleg Liked this on 12/23/2011 2:28:00 AM
Profile
Guru Samy Liked this on 3/29/2012 3:07:00 AM
Profile · Blog
Jacob Sebastian Liked this on 4/30/2012 5:38:00 AM
Profile · Blog · Facebook · Twitter
Khyati Patel Liked this on 4/30/2012 6:29:00 AM
Profile · Facebook · Twitter
abhIShek BandI Liked this on 5/1/2012 12:21:00 AM
Profile · Facebook
12
Liked
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

4  Comments  

  • Very nice :)

    commented on Dec 5 2011 6:36AM
    Jan Novak
    448 · 0% · 88
  • Good one..

    commented on Dec 5 2011 10:01PM
    Hardik Doshi
    20 · 9% · 2864
  • it's really cool.......

    commented on Dec 11 2011 11:18PM
    Shivendra Kumar Yadav
    60 · 3% · 936
  • Hi Madhivanan,

    Its vry interesting............

    But i want to know the logic behind this, can u help me to come out.

    commented on Apr 30 2012 5:26AM
    Bala Krishna
    83 · 2% · 676

Your Comment


Sign Up or Login to post a comment.

"Fun in TSQL - TSQL from TSQL" rated 5 out of 5 by 12 readers
Fun in TSQL - TSQL from TSQL , 5.0 out of 5 based on 12 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]