August 30, 2013 at 4:58 am
Sean Smith-776614 (8/29/2013)
Lesson is use the complete name. For example, rather than using "advanced options" use "show advanced options". If MS ever introduces "hide advanced options" then you may need to rewrite some code. Essentially, just be aware of how it works. Just an FYI. πJust curious, did you get it right or wrong?
Why would the server think that 'ow a' was a substring of 'hide advanced options'? :hehe:
Tom
August 30, 2013 at 5:12 am
An nice amusing question that demonstrates an unfortunate feature of SQL - using contractions is not a habit I would like to get into. so a good question about something that people may be unaware of. I hope people don't take away the lesson that this is a good thing to use, though.
However, the correct answer is wrong - the real answer is "it depends". Since security is a useful thing to have, I normally log into servers as a non-member of local administrators; if I then connect to SQL Server, I don't get SA privileges, because local admins (for machines not in a domain) or domain or enterprise admins (for machines in a domain) get SA privileges.
So whether the first call works or not depends on whether I remembered to log in as an admin user because I was going to try to switch xp_cmdshell on, or (more likely) remembered to leave my current unprivileged SSMS and start it up again as an admin user.
Of course the use of tick boxes indicates that more than one option is to be chosen, which gives the game away as only one of the three options could be true if I had connected without the required privileges.
Tom
August 30, 2013 at 6:50 am
L' Eomot InversΓ© (8/30/2013)
An nice amusing question that demonstrates an unfortunate feature of SQL - using contractions is not a habit I would like to get into. so a good question about something that people may be unaware of. I hope people don't take away the lesson that this is a good thing to use, though.However, the correct answer is wrong - the real answer is "it depends". Since security is a useful thing to have, I normally log into servers as a non-member of local administrators; if I then connect to SQL Server, I don't get SA privileges, because local admins (for machines not in a domain) or domain or enterprise admins (for machines in a domain) get SA privileges.
So whether the first call works or not depends on whether I remembered to log in as an admin user because I was going to try to switch xp_cmdshell on, or (more likely) remembered to leave my current unprivileged SSMS and start it up again as an admin user.
Of course the use of tick boxes indicates that more than one option is to be chosen, which gives the game away as only one of the three options could be true if I had connected without the required privileges.
I think you can always make this argument, though.
"What if the SQL Server had caught fire moments earlier ? Then none of the commands would work."
August 30, 2013 at 7:02 am
Thanks for all the feedback everyone. Again, just more of an FYI about the behavior of the sp. It just caught me off gaurd when I realized it worked this way and all I thought was "Wow, this is a BAD design." :p
August 30, 2013 at 7:35 am
Well, I learned something. Thanks!
August 30, 2013 at 7:41 am
Depending on the configuration setting of SQL you could have the option of both statements failing.
Unless the reconfigure statement was followed by "with override"
Reconfigure with Override
August 30, 2013 at 11:03 am
of course, if your aim is to save typing, rather than
EXECUTE sys.sp_configure
@configname = 'show advanced options'
,@configvalue = 1
type
exec sp_configure 'show advanced options',1
π
other than that the question highlights an interesting tid-bit of information.
---------------------------------------------------------------------
September 3, 2013 at 2:58 pm
The question has 'dsh' and the explanation has 'dhs' - which is it?
-------------------
A SQL query walks into a bar and sees two tables. He walks up to them and asks, "Can I join you?"
Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html
September 3, 2013 at 2:59 pm
webrunner (9/3/2013)
The question has 'dsh' and the explanation has 'dhs' - which is it?
Never mind. It is 'dsh' as in 'commandshell'.
π
-------------------
A SQL query walks into a bar and sees two tables. He walks up to them and asks, "Can I join you?"
Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html
September 4, 2013 at 8:59 am
alex.d.garland (8/30/2013)
"The SQL Server Database Engine recognizes any unique string that is part of the configuration name."Wow, I did not know that. Good question, I always like it when I learn something new.
+1
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
September 6, 2013 at 1:00 am
Definitely new thing for me. π
September 6, 2013 at 9:16 am
Good one, thanks!
September 7, 2013 at 6:03 am
interested to know more about it..........
September 7, 2013 at 6:05 am
What more would you like to know?
September 10, 2013 at 7:50 am
Very Interesting question
Malleswarareddy
I.T.Analyst
MCITP(70-451)
Viewing 15 posts - 16 through 30 (of 35 total)
You must be logged in to reply to this topic. Login to reply