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

SPACE function will return maximum of 8000 spaces only

Oct 27 2011 4:33AM by Madhivanan   

We can use SPACE function to replicate spaces for a string. Consider the following statement

select 'A'+space(10)+'B'

The result is

------------
A          B

As you see space function adds 10 spaces between the string A and B. Note that the space function though accepts any positive number, it will return maximum of 8000 spaces only which you can confirm from the following example

select datalength(space(10000))

The above returns 8000. So you should be aware of this. The alternate solution to have more spaces is to use replicate function as shown below

select datalength(replicate(cast(' ' as varchar(max)),10000))

Which returns 10000. Also note that replicate returns maximum 8000 characters so we need to convert the string to varchar(max) datatype to have more chanracters. Find out more details at Varchar(max) datatype and replicate function

Tags: sql_server, replicate, sqlserver, SQL Server, #SQL SERVER, space,


Madhivanan
3 · 39% · 12441
2
 
0
Lifesaver
 
 
0
Learned
 
0
Incorrect



Submit

2  Comments  

  • I enjoyed reading the document. But couldn't get, why it is behaving like so? Can u plz explain it in more specific.

    Thanks in advance.

    commented on Oct 28 2011 9:50AM
    Suvendu Shekhar Giri
    168 · 1% · 289
  • Becuase SPACE and REPLICATE functions by default will return only 8000 characters

    commented on Oct 31 2011 7:39AM
    Madhivanan
    3 · 39% · 12441

Your Comment


Sign Up or Login to post a comment.

"SPACE function will return maximum of 8000 spaces only" rated 5 out of 5 by 2 readers
SPACE function will return maximum of 8000 spaces only , 5.0 out of 5 based on 2 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]