|
|
|
SSChampion
        
Group: General Forum Members
Last Login: Friday, May 18, 2007 3:36 PM
Points: 10,040,
Visits: 1
|
|
| Comments posted to this topic are about the Question of the Day for 08 Oct 2004 posted at http://www.sqlservercentral.com/testcenter/qod.asp?QuestionID=362.
|
|
|
|
|
SSChampion
        
Group: General Forum Members
Last Login: Friday, May 18, 2007 3:36 PM
Points: 10,040,
Visits: 1
|
|
| No one has responded to this topic yet. Even if you don't have a complete answer, the original poster will appreciate any thoughts you have!
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 4:01 PM
Points: 2,282,
Visits: 694
|
|
Won't Statement B get an error in both DTS and Query Analyzer because it is missing the leading quote after the select statement?
Hal W Platt
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Tuesday, February 19, 2013 10:47 AM
Points: 226,
Visits: 22
|
|
That was my impression too. It must have been a misprint.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Friday, April 13, 2007 6:23 AM
Points: 170,
Visits: 1
|
|
I saw the exact same error. I do not think statement #2 will work at all.
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Tuesday, October 09, 2012 12:02 PM
Points: 340,
Visits: 231
|
|
haha I was going to say the same thing. Oh well.
Surefooted
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Tuesday, July 27, 2010 7:51 PM
Points: 1,244,
Visits: 3
|
|
Could someone post the KB article relating to this bug. I couldn't find it.
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 11:38 AM
Points: 2,818,
Visits: 1,037
|
|
The question as posed says Query B works (in spite of the missing quote). Assuming the missing quote is a misprint, are we to believe that Query B works without the modification given for Query A? If Query B also requires a CAST, then none of the answers fit the question. It becomes a trick question but not for the reason in answer 3, so all answers are wrong.
|
|
|
|
|
SSChasing Mays
      
Group: General Forum Members
Last Login: Friday, December 08, 2006 6:32 PM
Points: 635,
Visits: 1
|
|
I couldn't find anything on the Microsoft site about this bug, but I did find a discussion of it at http://www.dbforums.com/showthread.php?threadid=656046&goto=nextoldest. According to the messages there, the bug is somehow related to the length of the SQL query string, but there is a workaround by including a CONVERT or CAST in the query, as is shown in SQL Statement B. (It looks like the missing open quote in SQL Statement B was an oversight.)
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 11:38 AM
Points: 2,818,
Visits: 1,037
|
|
So if results over 75 chars are a problem, how can Query B (which returns a longer result) possibly work without using the workaround given in the explanation? The question says the problem does not occur for Query B, which is wrong, so none of the answers fit.
|
|
|
|