• da-zero (5/20/2010)


    honza.mf (5/19/2010)


    Maddy...! (5/19/2010)


    hello frnds....

    wht ever it may be in order to run completely a block of t-sql code it should be syntax error free

    i think there is no += operator in database so the code itself is wrong and u cant even think of it running how can you expect us to post answer for it.......

    This code is valid!

    += operator is legal in the current version of SQL Server.

    I expect people to answer questions without running code. I know, I'm old enough to be so naive.

    You should specify which environment is used in the question. As a SQL 2005 user, I saw that there would be an error. You even don't have to run the code to see that.

    I cannot guess which environment you had in mind.

    SQL Server 2008 has been around long enough that question makers can assume you'd recognise the syntax. If there had been an anwer option that matches what would happen on SQL 2005 ("illegal operator +=" or so), I'd agree with you about the trick question and the need to specify environment. But with the options given, your first impression might have been "syntax error", but then you should have reconsidered after missing that annswer option.

    As others say, this is just nitpicking; the question was clearly about XML.

    @honza.mf: Great question! I never work with XML myself so this was a good learning opportunity.

    The only thing I like less about the question was that it also required knowledge of IE to assess if the correct options was indeed correct. Had you formulated it as "XML segment, with the integrated parser marking most values illegal, but some browsers may be able to open this segment when surrounded by root element", it would have been completely perfect.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/