December 6, 2012 at 8:48 pm
Comments posted to this topic are about the item Which Statement will execute sucessfully
Malleswarareddy
I.T.Analyst
MCITP(70-451)
December 6, 2012 at 9:58 pm
easy one for friday ...
~ demonfox
___________________________________________________________________
Wondering what I would do next , when I am done with this one :ermm:
December 6, 2012 at 11:08 pm
easy +1:)
December 6, 2012 at 11:36 pm
easy one for the end of the week :-):hehe:
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
December 6, 2012 at 11:37 pm
Hi,
I accept ur answer, object name will be unique to the schema. What is the schema mapped for the current login user. U said we have only two schemas. then only first statement will execute final one will fail. could u Pls xplain in detail.
Thanks
Dinesh
--
Dineshbabu
Desire to learn new things..
December 7, 2012 at 12:02 am
What would happen, if the current user is mapped to any one of the two schema's by default? Last statement would always throw an error!!
As this option was not one of the choice, I marked all three statements will execute successfully.
~ Lokesh Vij
Link to my Blog Post --> www.SQLPathy.com[/url]
Follow me @Twitter
December 7, 2012 at 12:26 am
Lokesh Vij (12/7/2012)
What would happen, if the current user is mapped to any one of the two schema's by default? Last statement would always throw an error!!As this option was not one of the choice, I marked all three statements will execute successfully.
+1
Correct answer: success, success, it depends
"It depends" is my favorite answer.
December 7, 2012 at 12:50 am
Assumed I had rights to person and beneficiary schemas and got it right.
Otherwise the answer could be it depends,it depends,it depends
-------------------------------Posting Data Etiquette - Jeff Moden [/url]Smart way to ask a question
There are naive questions, tedious questions, ill-phrased questions, questions put after inadequate self-criticism. But every question is a cry to understand (the world). There is no such thing as a dumb question. ― Carl Sagan
I would never join a club that would allow me as a member - Groucho Marx
December 7, 2012 at 1:07 am
This was removed by the editor as SPAM
December 7, 2012 at 2:01 am
Since there is no such option. I too marked as all excute successfuly.
--
Dineshbabu
Desire to learn new things..
December 7, 2012 at 2:16 am
In which case the default schema is used, which if not set by the user would be dbo. Schema reference: http://msdn.microsoft.com/en-us/library/ms190387(v=sql.105).aspx 🙂
December 7, 2012 at 2:33 am
Bit worrying how many people found this easy without giving any consideration to what the default schema might be for the user. Easy to get it right if you assume dbo but that's a BIG assumption in the real world.
December 7, 2012 at 2:45 am
Not a bad question, but I might have answered S,S,F if it had been an option - no mention of default schema or rights on dbo schema.
December 7, 2012 at 3:06 am
I thought the question was clearly not about rights, but uniqueness in schemas, and thus not ambiguous, of course it might have been helpful to indicate rights were available. Though you might need to add that the network does not drop, disk space is still available, aliens don't squash the server etc if you are pushing it that far.
December 7, 2012 at 3:40 am
It should be added to the explanation that when you create a table without specifying the schema name, it uses the default schema for the database (which is most probably dbo) and that is why the third statement wouldn't fail with something like "table already exists"
Viewing 15 posts - 1 through 15 (of 33 total)
You must be logged in to reply to this topic. Login to reply