Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««1234»»»

Global Configuration Settings Expand / Collapse
Author
Message
Posted Friday, August 30, 2013 3:44 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, August 28, 2014 10:21 AM
Points: 1,219, Visits: 2,210
Interesting (although I can't imagine why it's been done that way).

It would have been nice if you had used one from the top of the list of options (maybe "uck") rather than the very last one, to save us having to trawl the entire list to see if any of them contained "dsh" (although with hindsight, it is a fairly obvious one).
Post #1490048
Posted Friday, August 30, 2013 4:10 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, February 6, 2014 4:15 AM
Points: 1,242, Visits: 1,546
Stewart "Arturius" Campbell (8/30/2013)
Interesting question, thanks Sean

+1




Thanks
Vinay Kumar
-----------------------------------------------------------------
Keep Learning - Keep Growing !!!
www.GrowWithSql.com

Post #1490061
Posted Friday, August 30, 2013 4:33 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: 2 days ago @ 9:16 AM
Points: 1,632, Visits: 5,585
Wow, did not expect that at all--why on earth would Microsoft make a system-level configuration procedure allow any old random garbage to work so long as it happens to be contained as a string in one of the real configuration names?
Post #1490064
Posted Friday, August 30, 2013 4:37 AM


SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Thursday, August 28, 2014 11:51 PM
Points: 608, Visits: 1,035
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


Pramod
SQL Server DBA | MCSA SQL Server 2012

in.linkedin.com/in/pramodsingla/
http://pramodsingla.wordpress.com/
Post #1490067
Posted Friday, August 30, 2013 4:38 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 2:48 AM
Points: 5,977, Visits: 8,238
paul.knibbs (8/30/2013)
Wow, did not expect that at all--why on earth would Microsoft make a system-level configuration procedure allow any old random garbage to work so long as it happens to be contained as a string in one of the real configuration names?

Probably because someone thought it would be useful to allow people to type only 'show advanced' (or even 'show adv') instead of the full 'show advanced options'. And just 'ad hoc' instead of 'optimize for ad hoc workloads'. And they never really considered the "less intuitive" uses such as in this question.

I do agree with Sean's warning though. It's not like you have to type commands like this many times per day, and I'd rather type the full option name and be safe from future surprises.


(BTW, I got the question correct, but only because I figured that there has to be a reason for this question. I had at first not even recogised dsh as a substring of the option name; to me it was just a random string of three letters).



Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Post #1490068
Posted Friday, August 30, 2013 4:58 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Yesterday @ 5:32 PM
Points: 8,738, Visits: 9,284
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'?


Tom
Post #1490077
Posted Friday, August 30, 2013 5:12 AM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Yesterday @ 5:32 PM
Points: 8,738, Visits: 9,284
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
Post #1490081
Posted Friday, August 30, 2013 6:50 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Wednesday, February 26, 2014 10:54 AM
Points: 376, Visits: 219
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."
Post #1490132
Posted Friday, August 30, 2013 7:02 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: 2 days ago @ 12:59 PM
Points: 342, Visits: 691
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
Post #1490139
Posted Friday, August 30, 2013 7:35 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Thursday, August 21, 2014 2:58 PM
Points: 543, Visits: 574
Well, I learned something. Thanks!
Post #1490153
« Prev Topic | Next Topic »

Add to briefcase ««1234»»»

Permissions Expand / Collapse