Archive for December, 2009

Work for a cause

This one is not related to SQL Server, in fact it is not related to any technology. This is about being responsible, to the society we live in and people we share this world with.

I laugh at people when they forward a chain email about an issue or a burning topic. Let me explain why I laugh at them; Instead of doing something towards solving the issue / problem in the email, these people forward email to friends making that issue a time pass issue, and at the same time feeling as if they are contributing to the solution of that problem.

One such email I received last fortnight was with pictures with different people suffering/ fighting with poverty or hardships with suitable captions as such as these, “Do you think you have too much burden to carry?” look at this—the pic has a cart with a huge pile and the person pulling it alone. “Do you always think of branded shoes?” look at this guy — the pic has a person who has no shoes and walking in dirt. “Do you worry you don’t have a great home?”  look– the pic has people sleeping on the roadside pavements, the email was with such a list of 10-15 things. The funniest part was the person who sent it to me and the Tag line of the email. “Be content with what you are blessed and be kind in helping others”. This guy, from what I know of him, has never worried to help anyone in need nor donated anything towards charities. It’s not this guy in particular there are many whom you know as well.

Don’t we know that there is poverty and people are suffering from scarcity of food, water and many basic things? We do know it but do not pay attention in solving them. I feel pity for those and try my part in helping them by doing a little bit of charity works. as a part of that, I did donate blood last week and it is the 8th time I am doing so and 2nd time in the last 10 weeks. I am planning to donate as regularly as I can in the near future. My only suggestion to my fellow readers, work for a cause and help as little as possible in your capacity.

Next time when someone sends such a mail, do not forward it just for fun think for a while and when you have done your part in addressing the problem in the mail, include that and forward it thus motivating your friends and family to take that message serious enough rather than one of those read, enjoy and forward it emails.

–Bru Medishetty

Side by Side Installation of SQL Server

Many SQL Server users (starters and intermediate level users) have a common doubt about the possibilities of installing multiple SQL Server instances on a same physical server. The answer is a cautious yes; the reason for being cautious is, not being sure about the behavior of the application(s) using the previous version of SQL Server.  Such a setup is called Side-by-Side installation. It is possible to have multiple Versions of SQL Server Instances on the same machine and also multiple editions of same version of SQL Server.

In the picture below you see that on the same machine, 4 SQL Server instances have been installed and 3 of them are SQL Server 2005 and the other being SQL Server 2008. Each one of the Instances is different from the other.

 

 

I used multi-server querying capabilities in SQL Server 2008 to find the information of all the servers in a single query. Coming to Side by Side Installations, it must be noted that this might be required when performing an upgrade on the same machine as the current one. This requires no additional hardware for setting up another system, but on the other hand, there is a risk factor in this, if the installation of the newer instances is unsuccessful and the system becomes unstable or the newer version of executables have known / unknown issues with respect to the working applications.

The decision to go for a Side by Side Installation or a new installation on a seperate system, varies. If it is being performed on a test server for some testing additional functionalities or features it would be a worth a try.  Whereas performing this on a system which cannot have downtime, it is not worth a risk to take.

–Bru Medishetty 

 

Querying Multiple Servers in SQL Server 2008

SQL Server 2008 provides the functionality of querying multiple Servers from a single query window. This is helpful for tasks like retrieving server information such as Version, Edition, Instance Name, logins available across each instance, databases on the servers etc.

In order to query multiple servers the only prerequisite is that the servers need to be registered prior to run the query and of course, there should be a valid login to connect to those Server. The SQL Servers can be of other version such as SQL 2000 or 2005. In this example I have two SQL Server 2005 instances and one SQL Server 2008 instance all of them are installed on a single Machine.

For the purpose of this article, I assume you know how to register a SQL Server in the Local Server Groups. Open registered servers from View menu or using keyboard short-cut Ctrl + Alt+ G (picture below).

 

Right click on the server group, from the pop up menu choose New Query as shown in the picture below.

 

A new query editor is opened which has is simalar to a normal new query editor. The only difference you find is the status bar down at the the bottom of the query editor. The picture below displays the status bar and we see the difference with a usual query editor status bar. This status bar does not a single instance name rather, displays the Server Group Name, also SPID information is not displayed.

 

I am running a simple query to retrieve the list of the user Databases on all the instances in the server group. The query results is displayed along with the query. The Database names are displayed along with SQL Instance name.

 

 

Those of us who would like to find the backup information of the critical databases or to find the SQL Agent Jobs that failed across several instance, that can all be done from a single query in SQL Server 2008.

–Bru Medishetty

 

Installing .NET 3.5 Framework in Windows Server 2008 R2

This article will guide through the steps to install .NET Framework 3.5 on a Windows Server 2008 R2.

I recently installed and started working on a Windows Server 2008 R2 Enterprise. I started installing SQL Server and I knew SQL Server 2008 requires the Microsoft .NET Framework 3.5 to be installed on the machine. The installation wizard displayed the following message box (picture below), which is common. (as I had previously installed SQL Server 2008).

I clicked OK button and the setup started loading the required components and immediately displayed the error message (picture below) , asking to install .NET Framework from Role Management Tool

To install roles on a Windows Server the roles have to be added in the Server Manager. So I opened the Roles node from the tree structure in the Server Manager and what you see below is what it looks like (only required portion of the screen is shown to make the images smaller and tidy). On the right side, Add Roles is available and we need to select / click that.

Upon selecting Add Roles, the Add Roles Wizard is displayed as shown below. I selected Application Server and on selecting it, there is a description available on the right side, what that role is going to provide or include.

 

The following information message box is displayed informing that to install an Application Server, there are certain other required features we need to include. All we need to do is to click the Add required features button in the message box.

It would then display the dialog box giving a short information of what an Application Server does. Click Next to continue.

I choose some additional roles apart from Application Server role, and the dialog box below is a confirmation of all the selections, click install to start the installation process.

The Installation begins. (Picture Below)

The installation is successful and the picture below is the dialog box confirming the success of the installation of the roles that we have chosen.

With that, the prerequisite for installing a SQL Server 2008 Instance is met, and we can continue installing SQL Server 2008.

–Bru Medishetty

Linked Server with Access 2007 Database

This article will explain the steps to create and using a Linked Server on an Access 2007 Database. The steps include creating a Linked Server using GUI and through T-SQL script.

The picture below displays location of the 2 Access Databases (My Documents directory) used in this exercise.

To create a Linked Server using the New Linked Server dialogs, start at the Server Objects in the Object Explorer in SSMS. Expand Server objects and on the Linked Servers, right click and select New Linked Server. (Picture below)

In the New Linked Server dialog box, type the linked server name that you would like to create and use (It is
not a must to have the actual name of the Access database, in the example we are naming
LINKEDSERVER_ACCESS
. For Server type, choose Other data source, and for Provider from the drop down
list, choose Microsoft Office 12.0 Access Database Engine OLE DB Provider.

For the Product Name, type ACCESS and for the data source give the location where the access database is located. (Picture below)

After entering above mentioned details, select the Security Page in the left hand pane of the dialog box. In the security settings choose the option Be made using the login’s current security context. Click Ok and the Linked Server is created.

The picture below displays the query to update a table and select statement to retrieve the table data.

Alternately you can add a linked server using the system stored procedure sp_addlinkedserver in the Master DB. The picture below shows the parameters for the stored procedure such as servername, srvproduct, provider and the datasource. After adding the Linked Server, the next query is a select statement to select few records from the newly created Linked Server.

 

–Bru Medishetty