THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | |
in Search

Tibor Karaszi

Watch out for old stuff

No, I'm not referring to me, I'm referring to options, config values and such which should really have been removed from the product a long time ago. I was reading a recent blog from Jonathan Kehayias and realize how much old stuff are still visible one way or the other in the product. There are of course commands which has more modern replacements (manage logins and users, attaching databases, changing SID for user etc), but keeing the old command for a few version is common sense. I'm thinking more of stuff where the functionality it gone ages, or even decades, ago, so why keep the knob for it?

Referring to Jonathan's article, the LoginMode property has in SMO and policies four possible values.

  • "Unknown" maps to registry value 3 or higher which is clearly rubbish (somebody manually changed this to something weird).
  • "Mixed" maps to value 2 in the registry, Known as "SQL Server and Windows", or "Mixed mode".
  • "Integrated" maps to value 1 in the registry. Known as "Windows only".
  • "Normal" maps to values 0 in the registry. But what is this, you think? There are only two values, right?

So, we have something strange exposed in SMO and policies, and it is even referred to as "normal". This is one example if heritage which should have been cleaned up a long long time ago. We have to go all the way back to SQL Server 6.5 in order to explain this.

  • "Normal" (more commonly known as "Standard" back in the days) is more like what "Mixed" is today.
  • "Mixed" meant something slightly different back then compared to what it means today. We need to recall that back then, we didn't have Windows authentication like how it is done today. We could map Windows account to SQL Server account using a tool, and this mapping could be used to do what we call today a "Windows authentication" or "trusted connection". This setting meant that SQL Server could attempt a trusted connection based on the login name you specify, even if you in the connection string didn't ask for a trusted connection. Confusing, huh? No wonder they got rid of the distinction bewteen "Normal" and "Mixed".

As of 7.0, the only registry values used are 1 (Integrated) and 2 (Mixed). So why do SMO still expose 0 (Normal)?

We have plenty of other such examples. Look in the registry and you can see mapping for _, # and $. These were used in the mapping tool, so you could map a Windows login, which apparently has a backslash in the name and SQL Server would translate the backslash to some other character (_ by default), allowed as a SQL Server login name. Why do these still exist in the registry?
Or "Default login"? There no such thing as a default login in SQL Server anymore (there is something like a guest *user* but that is a different things from a login.
Or how about setting the master database to full recovery model? That is absurd, you still can't do log backup and it still behaves like in simple recovery.

OK, enough of the rant. Back to meaningful work.

Published Wednesday, September 15, 2010 2:17 PM by TiborKaraszi
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Andy said:

It's a good day of development when I've managed to delete more old code than I've written new code.

September 17, 2010 10:11 AM

Leave a Comment

(required) 
(required) 
Submit
Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement