Default schema

  • Toreador

    SSChampion

    Points: 11257

    James Lean (3/31/2014)


    The script doesn't mention anything about the creation of king_login, so it is implied that this login already exists. In that case, we cannot assume that it either is or isn't already a member of any server roles, including sysadmin.

    This.

    A good question with a nice trap into which most people appear to have stepped 😉

    Some people need to take a deep breath when getting a question wrong rather than immediately posting an angry response about all the points they've somehow had taken away from them!

  • Koen Verbeeck

    SSC Guru

    Points: 258965

    Toreador (3/31/2014)


    Some people need to take a deep breath when getting a question wrong rather than immediately posting an angry response about all the points they've somehow had taken away from them!

    Answering questions is done before daily caffeine intake, so sadly that will not be possible 😛

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • This was removed by the editor as SPAM

  • Ed Wagner

    SSC Guru

    Points: 286982

    I agree with most of the previous posters here - that exception was pretty weak. I suppose it might be a problem if the login didn't exist or if the server happened to be offline.

  • Lynn Pettis

    SSC Guru

    Points: 442342

    Based on the information provided, the "correct" answer is wrong. There is nothing in the question to tell us that the login has been granted sysadmin privileges on the server.

    For once I agree, points should be awarded back.

  • Toreador

    SSChampion

    Points: 11257

    Lynn Pettis (3/31/2014)


    There is nothing in the question to tell us that the login has been granted sysadmin privileges on the server.

    Nor is there anything to say that it hasn't, hence the "it depends" answer.

    There isn't anything to say it even exists, but that error isn't one of the options so can be discounted.

    In case you can't tell, I got the answer right 😀

  • Victor Kirkpatrick

    Hall of Fame

    Points: 3672

    I went through the trouble of adding login king_login, and not as a member of sysadmin role. The table was created in the wonderland database with schema dbo, not king_schema. Anybody know why? Confused.

  • Victor Kirkpatrick

    Hall of Fame

    Points: 3672

    Victor Kirkpatrick (3/31/2014)


    I went through the trouble of adding login king_login, and not as a member of sysadmin role. The table was created in the wonderland database with schema dbo, not king_schema. Anybody know why? Confused.

    Nevermind, it was created with king_schema. Gah, such a frustrating question + answer.

  • Thomas Abraham

    SSChampion

    Points: 10761

    Koen Verbeeck (3/31/2014)


    WTH?

    The script doesn't mention sysadmin but database owner.

    The created user doesn't have sysadmin permissions, so the table will be created using the default schema.

    Points back please!

    I find it wise to never disagree with Koen. 😉

    OP should avoid submitting questions that require such "unusal" assumptions.

    [font="Verdana"]Please don't go. The drones need you. They look up to you.[/font]
    Connect to me on LinkedIn

  • sestell1

    SSChampion

    Points: 10230

    Hmm, I'm surprised how many people are complaining about this question.

    The answer depends on the server role memberships of the login.

    Since no information provided regarding the login's server role memberships, it cannot be determined which schema the table would be created in without further information.

  • Sean Lange

    SSC Guru

    Points: 286536

    Toreador (3/31/2014)


    Lynn Pettis (3/31/2014)


    There is nothing in the question to tell us that the login has been granted sysadmin privileges on the server.

    Nor is there anything to say that it hasn't, hence the "it depends" answer.

    There isn't anything to say it even exists, but that error isn't one of the options so can be discounted.

    In case you can't tell, I got the answer right 😀

    Following the same logic the "correct" answer could be wrong too because somebody changed the default schema to something else in some other script that wasn't part of the question.

    I would disagree and say that as posted the user absolutely does NOT belong to sysadmin because it was not in the code provided. If it is ok to assume that somebody added this user to the sysadmin role then it is also reasonable to assume the default schema changed.

    _______________________________________________________________

    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/

  • Toreador

    SSChampion

    Points: 11257

    Sean Lange (3/31/2014)


    as posted the user absolutely does NOT belong to sysadmin because it was not in the code provided. If it is ok to assume that somebody added this user to the sysadmin role then it is also reasonable to assume the default schema changed.

    You were given the code in which the schema and user were created, therefore it is reasonable to assume that no other changes were made. You were not given the code in which the login was created, so on what basis are you making assumptions about how it was set up?

  • Bobby Russell

    SSCrazy

    Points: 2667

    The correct answer is INCORRECT based upon the information given. We cannot assume the user is a sysadmin on the server.

    Points back!

  • sestell1

    SSChampion

    Points: 10230

    Bobby Russell (3/31/2014)


    The correct answer is INCORRECT based upon the information given. We cannot assume the user is a sysadmin on the server.

    Points back!

    While the question provided scripts for the creation of a database user, a user cannot be a member of the sysadmin role.

    The server login can be a member of the sysadmin role, but creation of the login was not provided as part of the question.

  • Sean Lange

    SSC Guru

    Points: 286536

    Toreador (3/31/2014)


    Sean Lange (3/31/2014)


    as posted the user absolutely does NOT belong to sysadmin because it was not in the code provided. If it is ok to assume that somebody added this user to the sysadmin role then it is also reasonable to assume the default schema changed.

    You were given the code in which the schema and user were created, therefore it is reasonable to assume that no other changes were made. You were not given the code in which the login was created, so on what basis are you making assumptions about how it was set up?

    True enough. I like the idea of the question and maybe a way to have improved on it would have been to create two logins, then add one of them the sysadmin. And ask the same question about where the table would be created for each of the two logins.

    _______________________________________________________________

    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/

Viewing 15 posts - 16 through 30 (of 61 total)

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