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, December 23, 2010 4:14 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Yesterday @ 10:15 AM
Points: 1,789, Visits: 507
Check your answer properly before submitting a question, because your so-called "correct answer" is wrong.
And so:
1. Go to the back of the class;
2. stand in the corner;
3. And wear a dunce's hat for three hours.
And see me after school.
And give me my point Mr Steve Thingimygig.

Ken.


You never know: reading my book: "All about your computer" might just tell you something you never knew!
lulu.com/kaspencer
Post #1038971
Posted Thursday, December 23, 2010 11:45 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Friday, July 4, 2014 12:41 AM
Points: 77, Visits: 37
By the way, they say in BOL 2008:
Each Transact-SQL statement should be terminated with a semicolon. This requirement is not enforced, but the ability to end a statement without a semicolon is deprecated and may be removed in a future version of Microsoft SQL Server.

Post #1039026
Posted Thursday, December 23, 2010 11:59 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, June 5, 2014 3:00 AM
Points: 69, Visits: 45
hi, i got answer 1,2,3,4
Post #1039031
Posted Friday, December 24, 2010 2:11 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 8:04 AM
Points: 1,800, Visits: 6,564
Rune Bivrin (12/23/2010)
While I find the question slightly pointless, I have to say I'm more than a little surprised that so many got it wrong. The question made it perfectly clear that 1,2,3,4 wouldn't be correct.


The question did indeed make it clear that it wouldn't be 1,2,3,4. I couldn't work out by looking at it how it could give any other answer, so I ran it and got 1,2,3,4.

That's how I got it wrong, and I assume that most people will have done something similar. Therefore I'm surprised that so many people got it right! There must be more people still using unsupported versions than I'd have predicted.
Post #1039056
Posted Friday, December 24, 2010 4:27 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 8:18 AM
Points: 1,620, Visits: 5,694
mtassin (12/23/2010)
Just FYI, different Operating systems do it differently anyway.

I'm pretty sure Unix/Linux doesn't put both CR and LF (Carriage Return and Line Feed) characters at the end of a line in a text file.


It doesn't, and neither did the Mac (even before it became UNIX derived with Mac OS X). However, I think they both use LF alone (0xA) as the line terminator--I've never encountered an OS that uses CR alone as a line terminator, but there may well be one out there!
Post #1039084
Posted Monday, December 27, 2010 2:11 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Friday, June 14, 2013 1:32 PM
Points: 94, Visits: 21
'Question of the day' is definitely such a favorite for so many. This is my second time in less than a month having lost points in spite of having answered in accordance with the output in SQL Server. The first time, the points were granted. Hope is still alive for this one!


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
Post #1039580
Posted Tuesday, December 28, 2010 11:11 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Friday, September 5, 2014 2:00 PM
Points: 2,160, Visits: 2,191
Only correct for 2005 RTM? Can't say as I like this question...
Post #1039895
Posted Tuesday, December 28, 2010 12:31 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, November 12, 2014 7:33 PM
Points: 226, Visits: 168
I too get 1, 2, 3, 4.
Post #1039947
Posted Tuesday, December 28, 2010 3:54 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, November 4, 2014 4:10 PM
Points: 104, Visits: 68
Using SQL SMSS 2008 I got 1,2,3,4 as well...

I have run into similar problems using -- as a commenting method, though never in SMSS. Once my sql scripts are implemented (as is specific to my employer), they are executed in their entirety as a single line. This causes ALL code after the --'s to become disabled. When comments are necessary in my scripts, I use /* to make my comments */ and avoid this problem.
Post #1040032
Posted Wednesday, December 29, 2010 5:54 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Tuesday, May 14, 2013 11:41 AM
Points: 77, Visits: 218
Dear friends:

I'm a little disappointed after reading the comments of this forum. Few people have liked or commented on the anomalous behavior described, and most, rude apart, are concentrated in two categories:
1) Give me back my point.
2) Have had the SP updated.

With the former, I apologized a few posts back for the disgust. Formally, it is true that the question is misleading. However, I do not agree with them that the game point lost is more relevant than the fact of learning something, even something you think that never in life is going to happen. In short, I think that curiosity must be above the game, but hey, it's my personal opinion.

For the latter, also explained above the reasons why the SP is not updated (for those not wishing to look for, suffice to say that our servers are outsourced. The administration is out of reach, and we can only report the situation , which we have already done.) Thank you for the information on the nature of the problem and its possible solution by updating. However, it goes without being condescending, because no match will guarantee you will not find one day a problem you don't know how to solve, and you'll like a sympathetic attitude (I suppose).

I have spent many years programming, I suffered a lot of headaches, especially in the beginning when everything was more handmade and generally incompatible. Now the problems are usually more routine, but every once in a while you find something like this, flashy, and then I feel surprised as a kid when we find the solution. That surprise is what I would have like to share with you and only a few have appreciated it, which I regret.

Without acrimony, greetings to all of you,
Post #1040218
« Prev Topic | Next Topic »

Add to briefcase «««34567»»

Permissions Expand / Collapse