Short post:
I came across this today:
Another example of how \’knowing\’ something is quite different to \’understanding\’ it.
Short post:
I came across this today:
Another example of how \’knowing\’ something is quite different to \’understanding\’ it.
Another simple choice this time 🙂
Assume you have 6 web services running off the same server (I\’m not a Web Service guy, so humour me a little).
4 of these Web Services tick over nicely, the 5th does not play nice with the others at times and the 6th is critical to line-of-business. When the 5th one decides not to play nice, it seriously affects all the other services on the box.
You have budget for a new server (this IS hypothetical after all).
Would you rather:
Protect the line-of-business web service by moving it onto the new server, leaving the 4 simple services and one bad boy ?
Or
Move the unfriendly web service to the new server, and leave the l-o-b service with the other 4 ?
Personally, option 2 gets my vote. If the unfriendly one decided to throw it\’s toys out of the pram, then at least it\’s the only one in the pram… It\’s kind of like moving the naughty kid to another class all by himself instead of taking smartypants out of school altogether.
Again, I\’d be interested in your comments !
OK, short one on partitioning this time 🙂
Kind of an odd situation, but we\’ve been having quite a serious discussion about this. Assume you want to partition by day (yes, 2day\”, we are quite mad), and you have to keep records in the partitioned table for a year.
Would you rather :
Create a partition function and scheme based on the date (2010-09-03), creating a new one whilst ageing the oldest each day
Or
Create a partition function and scheme using the DATEPART (DayOfYear) function, and reuse the partitions when next year comes around
And yes, this is in part related to the last post !
Because I\’m primarily a lazy DBA, I\’d go for option 2. It just seems a little more elegant – set it up once and let it roll. You get all the benefits of having the table partitioned without the headache of constantly maintaining it.
Comments are invited !
Before you start, this is NOT a post about Multiple Active Result Sets, so don\’t get too excited (but don\’t go away yet either – hear me out).
A perennial challenge between the DBA and his/her development colleagues is that they speak a different language and some things are bound to get lost in translation. A good team will use many different strategies for coping with this, other people will constantly be at loggerheads. The DBA wants to use native tSQL, the developer C# CLR stored procedures. The DBA wants to use out-of-the-box functions in SSIS, the developer .net code. We\’ve all seen this.
Unfortunately, Microsoft don\’t make it any easier for teams to begin to understand each other, because they use differing constructs in different tools to accomplish the same thing.
I\’ll explain:
Situation arose today where it was needed to get the day number for a given date. Simple enough to do in tSQL –Â
Nice and simple. What really irritated was that to accomplish the same thing to add a derived column to a pipeline in SSIS, you\’ve got a different syntax:
(Note the requirement for the double quotes around the DATEPART specification)
Is this really a problem ? Not so much, but it certainly doesn\’t help when you\’re trying to convince a dyed-in-the-wool tSQL guy that they should really take a look at this pipeline ETL stuff called SSIS because it\’s really easy….
All I\’m pointing out here is that maybe things could be a little better integrated. SQL2005 introduced CLR and .net scripts inside stored procedures, but I don\’t see anything allowing tSQL to drive things the other way round.
Please could someone prove me wrong about this ? Is there such a \’killer app\’ that will let DBAs and Developers perhaps not talk the same language, but at least allow them to use a common thesaurus ?Â
begin
  return( select case
        when @flagToConvert in (\’Y\’, \’1\’, \’T\’) then \’true\’
        else \’false\’
      end)
Hope this helps !
 \”Simple.\” I hear you cry. \”Just look at the logins on the server, and compare those with the groups the user is in in Active Directory.\”
 But what if there\’s no match ? For us DBAs, it\’ll usually be a group mapped to SysAdmin, so no challenges there. But what if it\’s someone else who has several levels of nested AD groups, only one of which actually grants SQL access way down the tree ?
 I found a few security DMVs to help out here, sys.login_token and sys.server_principals.
 I think it works like this:
 When you add a login to SQL Server FROM WINDOWS , it will check the name given against AD, get the SID associated with the group, and add that (as well as some other stuff) to sys.server_principals
 When you connect to SQLServer as a user, your request contains all of the names (and SIDs) that you\’re a member of. All of them. Even the nested ones.
 (You can try this out by connecting to any instance of SQL using Windows Authentication, and executing SELECT [name] FROM sys.login_token – you\’ll get more rows back than groups that you\’re a direct member of in AD)
 SQL Server then has to match up any of the SIDs in your request with those in sys.server_principals. If it finds one, you\’re in – if not, you can\’t authenticate any further and you get access denied.
 So, going back to my original request, I got the end-user to execute the following query:
 They then mailed me the results of this, and I could immediately see that they were a member of 2 groups that had access to the required instance. Their issue was that they appeared to be entering dates in both British and US formats in different databases – a problem easily diagnosed to the language settings of the groups that they were in
 (one was British English, the other English, and I don\’t need to tell you what that means.), but to track that down using SQL and AD alone would have taken quite some time.
 If you need to find out which groups grant you access to SQL Server, use the script above. No special permissions are required to use these DMVs, so anyone with access to Management Studio can use it to find our which groups grant them access. If the user doesn\’t have access to Management Studio, then it\’s not a big job to create either a vbScript or exe that executes the statement above (but you\’re on your own here – unless you\’re really stuck, in which case I\’ll help out if I can)