Geeks With Blogs
BizTalk Blog by Chris Han System Design for Enterprise Agility,

Here is how you should play it:
1. Make sure your have both a SQL 2000 with latest sp and a SQL 2005 database
2. guess the result of the two 'print' command in the script below, write down the last character in the string on your mind
3. Run the script below in SQL 2000
4. Change the 3999 to 3998 and run it again on SQL 2000
5. Change the 3998 back to 3999 and run it on SQL 2005

 ---------------------------------------

declare @n varchar(4000)

set @n = replicate(N'z',3999)+N'i'

print @n

set @n=replace(@n, N'i', N'B')

print @n

-----------------------------------------

have fun

Posted on Tuesday, October 23, 2007 11:55 AM SQL Server | Back to top


Comments on this post: A little after lunch game for T-SQL develoepr - how confident are you with your code?

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Chris Han | Powered by: GeeksWithBlogs.net