GO Part 2

  • Thomas Abraham (9/13/2012)


    Thanks for the question. I got it right, but did so with a semi-educated guess. I reasoned that, if the answer was FALSE, this is a useless question of a type on which you can make unlimited variations.

    Agreed -- but it was fun to go through the detective work of understanding WHY the answer was TRUE and how to make the script run.

    Good question!

    Rob Schripsema
    Propack, Inc.

  • Sean Lange (9/13/2012)


    honza.mf (9/13/2012)


    Sean Lange (9/13/2012)


    Good question.

    For everybody who seems to be hung on the verbiage I can only say "GET OVER IT". English is not the native tongue of everybody on this site. I mean seriously folks, you are complaining about the exact verbiage of the multiple choice responses to a trivia question. The answers were pretty obvious what was meant. I applaud Kenneth for his creative thinking in coming up with this question. To the complainers...I haven't seen you offer any QOTD to the public. It takes great courage because the crowd on these will nitpick you to death on the smallest minute detail that has no affect on the question.

    Keep them coming Kenneth and don't let these people throwing rotten tomatoes at you discourage you from creating new ones.

    Presne tak, máte úplnou pravdu :hehe:

    Now this I have no idea what it says. 😛

    According to translation by Bing:

    Exactly, you're absolutely right

  • If it is a colleagues' idea of fun to play around with system/environmental settings, they should be sacked.

  • Congratulations to El Jerry and Lynn Pettis. 😀

    I used my native language because "The Czech dialect is said to be of great antiquity and of highly scientific cultivation. Its alphabet contains forty-two letters, suggestive to a stranger of Chinese. It is not a language to be picked up in a hurry." (J.K.Jerome Three Men on the Bummel) 😉



    See, understand, learn, try, use efficient
    © Dr.Plch

  • The given answer to this question is "true", but I am not sure this is correct. The "NotGo" throws an error "Incorrect syntax near 'NotGo'" and the variable @test-2 cannot be declared twice the same procedure or batch...What am I missing?

  • joe.wolfe (9/13/2012)


    The given answer to this question is "true", but I am not sure this is correct. The "NotGo" throws an error "Incorrect syntax near 'NotGo'" and the variable @test-2 cannot be declared twice the same procedure or batch...What am I missing?

    Read the explanation and/or the 5 pages of comments.

    If you change your batch separator to "NotGo" then the variables are declared in different batches and there are no errors. The point of understanding is to realize that Go is NOT a t-sql command. It is used as a batch terminator in SSMS.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • joe.wolfe (9/13/2012)


    The given answer to this question is "true", but I am not sure this is correct. The "NotGo" throws an error "Incorrect syntax near 'NotGo'" and the variable @test-2 cannot be declared twice the same procedure or batch...What am I missing?

    Joe,

    The NotGo is causing an error because it is not a valid statement, but you can set SSMS to use it as a batch separator in:

    - Tools/Options/Batch Separator (make sure you reset it before closing SSMS), or

    - right click on the query window, select Query Options, and change Batch Separator (this does not require resetting)

    Hope this helps.

    "El" Jerry.

    "A watt of Ottawa" - Gerardo Galvan

    To better understand your help request, please follow these best practices.[/url]

  • Oh....much better.... I never knew that....Thank you!!!!

  • I picked the right answer but for a totally different reason.

    I can easily run the script without error by highlighting/blocking the first batch excluding the NotGo word, same with the 2nd batch. That's what I thought the question is all about. It's good to know about this option, I would never have known it otherwise.


    Urbis, an urban transformation company

  • Wow... I thought this was a pretty tricky question. When I viewed it I thought it can't be as simple as False because no one would post a question that easy. It took me a while to figure out how and a few searches on the go seperator but I finally managed to get it to execute.

    What I found most interesting is in SSMS the change to the batch seperator option is not picked up immediately by your open windows. You actually need to open a new one to pick up the setting.

    I really enjoyed this question because I struggled and learned something new. Thanks!!

  • Bronzo (9/13/2012)What I found most interesting is in SSMS the change to the batch seperator option is not picked up immediately by your open windows. You actually need to open a new one to pick up the setting.

    That's one of the funny parts of SSMS. Each connection has its own set of settings, which will most often not be influenced by changes made to other connections in the same SSMS.

    (see also the note in an earlier comment about being able to change this for a single existing connection, thus not having to remember to reset your SSMS settings).

    Thanks for the question. I had seen the option to change "go" at some other time, but had forgotten all about it until now. And yes, i got the answer right 🙂

  • I got it right only because I was expecting a trick question. 😀

  • joe.wolfe (9/13/2012)


    The given answer to this question is "true", but I am not sure this is correct. The "NotGo" throws an error "Incorrect syntax near 'NotGo'" and the variable @test-2 cannot be declared twice the same procedure or batch...What am I missing?

    You are missing the entire discussion thread which, as usual, provides a great deal of additional information about the question, its intent, and the reasons for the the correct answer from several different points of view.

  • For me is not showing "Go" but "NotGo", so do not hit the reply

    Português-Brasil

    Para mim não está aparecendo "Go" e sim "NotGo", por isso não acertei a resposta

  • My first impression about this question was very negative.

    Question itself is not clear and right answer is definitely "false". It is a disaster to have an interview with somebody who would ask similar questions 🙂

    Discussion is much more useful. I got a lot useful information about things which were outside of my daily routine.

    Artur

Viewing 15 posts - 46 through 60 (of 82 total)

You must be logged in to reply to this topic. Login to reply