Help: SQL Server

Sharing my knowlege about SQL Server Troubleshooting Skills

  • Blog Stats

    • 2,156,901 hits
  • Select GETDATE()

    March 2026
    M T W T F S S
     1
    2345678
    9101112131415
    16171819202122
    23242526272829
    3031  

Tips and Tricks: One Query – Multiple Servers – One Result Set

Posted by blakhani on September 9, 2014


How many times you have been into a situation where you need to run one query across many servers? I have asked his question from one of the DBA and his answer was I will create a linked server and then modify the query to refer linked server. Well this needs modification to server configuration and most of the production server don’t allow changed without change request.

The better approach would be to use an under-estimated feature of SQL Server Management Studio called as Multiserver query. This can be done via by creating a group and registering one or more registered servers within the groups. Once group is created then we can query the complete group and the result format can be customized. Pinal (b|t) has written a blog here. This is a extension of that blog in little more details. 

To get to below option we need to open “Registered Servers” Window. If you don’t see it hit Ctrl+Alt+G or go to View > Registered Servers. I have registered two server under a group called “Fake Production”. We can created your own hierarchy to logically group the servers. Display Name can also be changed in this windows. I have given a name as “HiddenName” to one of my instance for display purpose. Effectively I have 4 Servers under “Local Server Groups” and 2 Servers under “Fake Production Group”

We can right click on any of the node and choose “New Query” as shown below.

First thing you would notice is that the color of status bar is changed. Also notice that we can see how many servers are connected out of total servers. For demo purpose I have used different account to connect each server that’s why we are seeing “<various logins>”

Color Customization can be done by going to Tools > Option > Text Editor > Editor Tab and Status Bar as shown below.

 

From above, we can also change other setting for status bar but they are not specified to multi-server.

If we ran a query in this query window, it would run on all the servers and give results.

We are seeing same number of databases on 1st and 4th row in my lab because they are same servers. dot (.) and (local) both means local server.

This result can be customized using “Tools > Option > Query Results > SQL Server > Multiserver Results” as below

Note: We can’t join two tables across the servers using multiserver query feature.

Hope this would help in getting some quick reports from various servers.

  • Cheers,
  • Balmukund Lakhani
  • Twitter @blakhani
  • Author: SQL Server 2012 AlwaysOnPaperback, Kindle
  • Posted in Tips and Tricks | Tagged: , , | Leave a Comment »

    Solution: Unable to launch SQL Server Configuration Manager – Invalid class [0x80041010]

    Posted by blakhani on September 4, 2014


    While launching SQL Server Configuration Manager on one of my machine, I got below error

    image

    Here is the text of the error message:

    —————————
    SQL Server Configuration Manager
    —————————
    Cannot connect to WMI provider. You do not have permission or the server is unreachable. Note that you can only manage SQL Server 2005 and later servers with SQL Server Configuration Manager.
    Invalid class [0x80041010]
    —————————
    OK  
    —————————

    There might be various reason for this error. In this case our actual problem is “Invalid class” which I have highlighted above. I have looked further and found that below is the solution for me. Same solution also works for Invalid namespace [0x8004100e] error also. 

    image

    C:\WINDOWS\system32>mofcomp "C:\Program Files (x86)\Microsoft SQL Server\120\Shared\sqlmgmproviderxpsp2up.mof"
    Microsoft (R) MOF Compiler Version 6.3.9600.16384
    Copyright (c) Microsoft Corp. 1997-2006. All rights reserved.
    Parsing MOF file: C:\Program Files (x86)\Microsoft SQL Server\120\Shared\sqlmgmproviderxpsp2up.mof
    MOF file has been successfully parsed
    Storing data in the repository…
    Done!

    MofComp is a command line utility to compile MOF (Managed Object Format) files and store the data in WMI repository. The MOF Compiler is available in the %Windir%\System32\wbem directory. So if you are getting “‘mofcomp’ is not recognized as an internal or external command then try changing current directory from command prompt to %Windir%\System32\wbem

    Also note that in mof file on my machine is under 120 folder. Depends on SQL version installed, you may have it in different folder. The value of that number depends on the version of SQL Server.

    Microsoft SQL Server 2014

    120

    Microsoft SQL Server 2012

    110

    Microsoft SQL Server 2008 R2

    100

    Microsoft SQL Server 2008

    100

    Microsoft SQL Server 2005

    90

     

    Hope this helps.

  • Cheers,
  • Balmukund Lakhani
  • Twitter @blakhani
  • Author: SQL Server 2012 AlwaysOnPaperback, Kindle
  • Posted in Error, Troubleshooting | Tagged: , , , | 31 Comments »

    A-Z of In-Memory OLTP: Online gaming casinos can handle more data per second

    Posted by blakhani on September 2, 2014


    I have been working with this new feature since its release and I am always amazed to see how it can change the world. Running an online casino is no joke. Not only do providers need to make sure that their customers are protected from data theft, but they also need to be certain that servers are always stable especially during peak hours. An overloaded server disconnects a player from the game, and providers can’t afford that to happen all the time. Competition is tight, so online casinos need to keep their customers happy.

    Cryptologic, the world’s first casino brand to offer gaming services to the public in 1996 through their brand InterCasino, said that in the past, they used to only handle 14,000 people on one server. But today, according to the data by Statistica, online casino is now a 39.5 billion dollar industry that’s played by millions of people around the world. A stable server today should at least be able to handle a quarter of a million requests per second.

    A case study by Microsoft revealed how a casino gaming site can scale up to 250,000 requests per second, and improve the gaming experience of players through an In-Memory Online Transaction Processing (OLTP) solution in Microsoft SQL Server 2014. According to the casino gaming site, it used to be able to handle only 30,000 batch requests per second. But with the upgraded system, not only can it handle 250,000 requests per second, but also provide their players a smooth gaming experience.

    As I explained in first part of series SQL Server that uses a main memory optimization and no-locking/no-latching concurrency control in order to remove the jam that’s causing the scaling up. Using the OLTP in the feature has also improved the response time to 2-3 milliseconds, which is way faster than the old system that the online casino gaming site uses that needed a 50 millisecond delay.

    Every second counts in a casino game – May it be poker or slot machine. By integrating an in-memory OLTP in Microsoft’s SQL server 2014, casino providers will be able to provide a faster and more stable gaming experience to their customers. Read more about Microsoft’s case study here

  • Cheers,
  • Balmukund Lakhani
  • Twitter @blakhani
  • Author: SQL Server 2012 AlwaysOnPaperback, Kindle
  • Posted in A - Z Series, In Memory OLTP, In-Memory OLTP | Tagged: , , | 5 Comments »