Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Subtle Line Feed / Carriage Return issue


Subtle Line Feed / Carriage Return issue

Author
Message
Subhash Kr Singh
Subhash Kr Singh
SSC-Addicted
SSC-Addicted (445 reputation)SSC-Addicted (445 reputation)SSC-Addicted (445 reputation)SSC-Addicted (445 reputation)SSC-Addicted (445 reputation)SSC-Addicted (445 reputation)SSC-Addicted (445 reputation)SSC-Addicted (445 reputation)

Group: General Forum Members
Points: 445 Visits: 210
I have tested this.
In context of SQL Server 2000 it is correct answer as by you.
But In SQL Server 2008 answer will be 1,2,3,4.

:-P
tejaswini.patil
tejaswini.patil
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1060 Visits: 234
I executed the scriptin SQL Server 2005, Got following output -


What you see...
-----------------------
print 1
-- Comment one
print 2
-- Comment two
print 3
-- Comment three
print 4

is not what you get!
-----------------------
1
2
3
4


I want to understand why the output will be 1, 3, 4?? Can anyone explain how it is correct?
paul.knibbs
paul.knibbs
SSCommitted
SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)

Group: General Forum Members
Points: 1972 Visits: 6213
tejaswini.patil (1/26/2011)
I want to understand why the output will be 1, 3, 4?? Can anyone explain how it is correct?


Have you tried reading the rest of the comments? It's already been pointed out multiple times that the answer as given only applies to SQL 2000--later versions produce 1,2,3,4.
terrykzncs
terrykzncs
Say Hey Kid
Say Hey Kid (666 reputation)Say Hey Kid (666 reputation)Say Hey Kid (666 reputation)Say Hey Kid (666 reputation)Say Hey Kid (666 reputation)Say Hey Kid (666 reputation)Say Hey Kid (666 reputation)Say Hey Kid (666 reputation)

Group: General Forum Members
Points: 666 Visits: 134
I suppose it would be SQL 2000 vs SQL 2005 and the bug has been fixed, but I want that point. Alien
vijay d
vijay d
Valued Member
Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)

Group: General Forum Members
Points: 62 Visits: 67
me too...
TomThomson
TomThomson
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10696 Visits: 11991
terrykzncs (4/29/2011)
I suppose it would be SQL 2000 vs SQL 2005 and the bug has been fixed, but I want that point. Alien

Not quite. It is indeed SQL 2000 vs SQL 2005. But rather than a bug having been fixed, a really stupid bug has been added - intentionally. See http://www.sqlservercentral.com/Forums/FindPost1038756.aspx for a simple explanation.

Tom

patricklambin
patricklambin
Hall of Fame
Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)

Group: General Forum Members
Points: 3508 Visits: 1240
It would be useful to see in a question the exact version of the SQL Server used for the test.
Moreover , the "bug" has disappeared after the arrival of the SP3 which should have been applied already in 2010 when this question was proposed .
Is there any control about the correctness of the solution ?
If the question is related to SQL Server 2005 RTM , I am doubting that there are many DBA accepting not to have installed the last service pack ( at least for security reasons ).
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search