Automatically add Partition for Partitioned Tables

This stored procedure helps automatically create new partition on a new file group to an already partitioned table. I have tested the script in my testlab. Please review and let me know for any corrections if required.

Continue reading “Automatically add Partition for Partitioned Tables”

Failover Cluster Manager (cluadmin.msc) GUI crashes in Windows Server 2012

One fine day, I was given a project to deploy a failover cluster on Windows server 2012. I did all the usual steps. Enabled failover clustering feature, Validated and created the Windows cluster. But unfortunately, when I click on the cluster name or any group or resource in the Failover Cluster Manager GUI, below popup shoots out and the cluadmin.msc stops responding.FailoverCluster GUI Error Continue reading “Failover Cluster Manager (cluadmin.msc) GUI crashes in Windows Server 2012”

Install .net Framework 3.5 on Windows Server 2012

Normally until Windows Server 2008, we use to have the .net Framework available to enabled from Server features section in Server manager. We just have to enable the feature to install .net FW 3.5.

Here we ran into a situation where we had to install SQL Server 2014 on a Windows 2012 Server. .net Framework 3.5 was required for SQL 2014 and Windows 2012 didn’t have that by default. Also, unlike SQL Server 2008 or 2012, 2014 setup doesn’t install it by itself. It just say’s that it needs to be installed manually. We tried to enable the feature via Server manager, but it fails saying the source files doesn’t exist.

Below is how we finally managed to install .net 3.5.

  1. There is a folder named sxs in Windows Server 2012 / 2012R2 Install Disk. We extracted the sxs folder from a disk image and copied them over to C:\Softwares\Source\sxs folder on the target 2012 windows server.
  2. Open a powershell prompt and execute below command. It would take few minutes to complete and you now have .net Framework 3.5 on your Windows Server 2012.

MongoDB M102 Final Exam Completed!

Final: Question 1

Problems 1 through 3 are an exercise in running mongod’s, replica sets, and an exercise in testing of replica set rollbacks, which can occur when a former primary rejoins a set after it has previously had a failure.

Get the and a.js files from Download Handout link. Use a.bat instead of on Windows.

Start a 3 member replica set (with default options for each member, all are peers). ( will start the mongod’s for you if you like.)

You will need to initiate the replica set yourself.

Continue reading “MongoDB M102 Final Exam Completed!”

Microsoft spelling mistake in SQL Server 2012

Hey. Its not just me. Even Microsoft makes spelling mistakes in their softwares… Just found below in an error window from SQL Server 2012 Enterprise edition. The mistake is highlighted in yellow. ūüôā

The mistake is highlighted
The mistake is highlighted

SQL Server 2012 / 2014 Always-on in Microsoft Windows Azure

We have heard enough of the new feature in SQL Server 2012 that replaces our conventional Database Mirroring notion. It is the Always-on Availability groups feature. I have carried out several tests setting up Always-on on my virtual data-center in my laptop. One fine day at office, I was assigned a project to build an Always-on availability group in Microsoft Azure.

Let’s first go through the prerequisites.

  1. Availability group replicas must reside in a single Cloud service.
  2. Availability group Listener IP should be same as the public Cloud service IP assigned to each replica.
  3. Two endpoints has to be created for the Cloud Service in Azure dashboard. One for the probe port(Through which the Azure Load Balancing services monitors the health of each virtual machine) and one for Always-on Listener port. Probe port should be different from the Listener port. For eg. Give 59999 for Probe port and 1433 for the always-on listener port.
  4. Install the hotfix 2854082 to enable SQL Server Availability Group Listeners on Windows Server 2008 R2 and Windows Server 2012-based Microsoft Azure virtual machines.

Limitations in Azure:

  1. Each virtual machine in Azure could have only one Ethernet card and one private IP. This limitation stops us from using a private IP for Always-on availability group. Even if we give a private IP for the listener, the IP will not ping or connect over the network.
  2. The client application must reside on a different cloud service than the one that contains your availability group VMs. Azure does not support direct server return with client and server in the same cloud service.
  3. Only one availability group listener is supported per cloud service because the listener is configured to use the cloud service IP address.
  4. If you are creating a listener for a hybrid environment, the on-premises network must have connectivity to the public Internet in addition to the site-to-site VPN with the Azure virtual network. When in the Azure subnet, the availability group listener is reachable only by the public IP address of the respective cloud service. Ref:

I went ahead and started working on it. I asked for 4 virtual servers.
Continue reading “SQL Server 2012 / 2014 Always-on in Microsoft Windows Azure”

Monitor Page splits using Extended Events session in SQL Server 2012

There are several ways to configure and start monitoring page splits on SQL Server. But now in 2012, we could make use of extended events to easily track down page splits.

If you do not want to go through the session wizard, I am sharing the script with which you could create the session in one go.

Continue reading “Monitor Page splits using Extended Events session in SQL Server 2012” – Easily share or keep track of your expenses – Free

I am happy to announce the launch of my webApp+androidApp+desktopApp software It’s a free tool for anyone or friends and roommates to share and split expenses. At the end of the trip,¬†day, week¬†or month, would calculate all your expenses and would suggest who owes whom.

Subscribe to to know more on the product, receive updates, news and release updates.

The url when opened on your smartphone(Android, IOS or Windows), opens as webapp with intuitive interface.


Replication – Adding New Article without Generating Snapshot – By Nideesh

Below article on replication was written by my colleague Nideesh K Vasudevan. I would like to thank him for his easy to understand input on this topic.

There were lot of requirements in replication to add new article with out
running snapshot. Some article explained ‘how to include only the newly
added article in the snapshot with out generating snapshot of all the

All my play only with different publication properties gave me failed
output but a test to also play with subscription property worked!!!!!!!!!!

3 properties that we need to consider are 1) Immediate_Sync
2)allow_Anonymous in the publication properties and important one is 3)
@Sync_Type in subscription properties.

Immediate_Sync and allow_anonymous publication properties

1) The above 2 values do not determine if a snapshot is needed for a new
article, but it determines if snapshot need to be generated for all the
article or only for new article.
2) If both the above options are enabled/true and when we generate a
snapshot after adding new articles, the snapshot will be generated for all
the articles (new article+old article).
3) If both the above options are disable/false and when we generate a
snapshot after adding new articles, the snapshot will be generated only for
newly created article. (only for new article)

@Sync_type – Subscription property

1) The above option determines if a snapshot needs to be generated for
newly added article.
2) If the value of @Sync_type is set to ‘none’ or ‘Replication support
only’ then its enough we just create table structure on both publisher and
subscriber and enable the new table in the publication. When the new data
comes in, it will get replicated automatically.
No snapshot is needed in this case and the application is working with the
above option (@Sync_type=’Replication support only’). Hence adding new
article by creating table structure on publication and subscription got
replicated with this option enabled.
3) If the @sync_type option is set to automatic then for sure we need a
snapshot for newly added article. – Immediate_sync option determines if
snapshot need to be generated for all article or only new article. – Use
this link to see about @sync_type option.

Windows remote session monitor and control

This tip would help you retrieve the list of users currently logged on to a remote windows server and disconnect any user if required.

To see the list of user sessions on a remote windows server, use either of the below queries.

“query session /SERVER:<servername or IP Address>”


“qwinsta /SERVER:<servername or IP Address>”

To terminate a session, note down the session ID from the output obtained from above commands. Execute below commands to terminate a session.

  1. “net user /user:<Administrator login> \\<servername or IP Address>\C$” . Enter password when prompted.
  2. Execute “reset session <ID> /SERVER:<servername or IP Address>” or use the command “rwinsta <ID> /SERVER:<servername or IP Address>”