Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««34567

Subtle Line Feed / Carriage Return issue Expand / Collapse
Author
Message
Posted Thursday, January 6, 2011 5:39 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, July 14, 2015 4:19 AM
Points: 369, Visits: 198
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.

Post #1043682
Posted Wednesday, January 26, 2011 11:32 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, April 19, 2011 1:59 AM
Points: 1,042, 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?
Post #1054390
Posted Thursday, January 27, 2011 4:57 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Wednesday, July 29, 2015 4:33 AM
Points: 1,723, Visits: 5,918
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.
Post #1054480
Posted Friday, April 29, 2011 12:55 PM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Sunday, March 4, 2012 4:02 AM
Points: 660, Visits: 134
I suppose it would be SQL 2000 vs SQL 2005 and the bug has been fixed, but I want that point.
Post #1101012
Posted Tuesday, May 17, 2011 5:24 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, June 21, 2012 1:29 AM
Points: 62, Visits: 67
me too...
Post #1110084
Posted Tuesday, May 17, 2011 5:41 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Today @ 7:19 PM
Points: 8,677, Visits: 10,484
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.

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
Post #1110097
Posted Sunday, December 21, 2014 12:49 PM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 1:37 PM
Points: 3,178, Visits: 863
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 ).

Post #1645751
« Prev Topic | Next Topic »

Add to briefcase «««34567

Permissions Expand / Collapse