March 31, 2014 at 4:28 am
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!
March 31, 2014 at 4:30 am
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
March 31, 2014 at 5:00 am
This was removed by the editor as SPAM
March 31, 2014 at 5:00 am
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.
March 31, 2014 at 5:13 am
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.
March 31, 2014 at 5:20 am
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 😀
March 31, 2014 at 5:55 am
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.
March 31, 2014 at 5:58 am
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.
March 31, 2014 at 7:06 am
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
March 31, 2014 at 7:07 am
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.
March 31, 2014 at 7:08 am
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/
March 31, 2014 at 7:12 am
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?
March 31, 2014 at 7:29 am
The correct answer is INCORRECT based upon the information given. We cannot assume the user is a sysadmin on the server.
Points back!
March 31, 2014 at 7:43 am
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.
March 31, 2014 at 7:48 am
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 60 total)
You must be logged in to reply to this topic. Login to reply