.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Detect other versions of SQL Server, or SQL server instances on a computer

Posted By:      Posted Date: August 28, 2010    Points: 0   Category :Sql Server
Hi All, I want to detect other versions of SQL Server, or SQL server instances on a computer. I used the recommended Microsoft C# example by using the SQL Server Windows® Management Instrumentation (WMI) provider. http://msdn.microsoft.com/he-il/library/dd981032(en-us,SQL.100).aspx SQL server 2005 has been correctly identified on my PC with Windows 7 64 bit OS. Then I uninstalled the SQLserver and all its tools/components. But even after uninstall the utility detects the SQL server 2005 as if it was not removed. What is an alternative for the correct detection of the SQL server installed on PC? Thanks in advance Dmitry

View Complete Post

More Related Resource Links

Detect if code is running inside SQL Server.

Can managed code "detect" if it is running in the normal .Net CLR or the special SQL Server CLR? Is there some environment flag or field we can look at at runtime? Thanks Cap'n  

SQL Server Express 2008 Setup fails. Support Rule "Restart Computer" Failed

Hi, I have been trying to install SQL Server Express for most of the day now without any luck.  Whatever I do setup fails at the stage of Setup Support Rules, Rule "Restart Computer" - Failed.  Needles to say I have restarted (several times!) and I have tried downloading  and installing the "Advanced", "Tools" and "Basic" versions, all give the same error.  Trying a repair does the same.  I have been searching the net for an answer without success, any help would be MUCH appreciated. Further info: I am trying to install a stand-alone installation on to a single PC running under XP SP 3 with .NET 3.5 SP1 installed.  The PC did have some earler versions of SQL server installed but I (?hopefully?) removed all of these through Control Panel.  Before trying the first SQL install I installed Windows installer 4.5 and PowerShell 1.0 as per the Microsoft Instructions. Running SQL Server Configuration Manager results in an error (MMC could not create the snap-in. The snap in might not have been installed correctly).  A directory structure for SQL server exists in "Program Files".  Services MSC shows SQL Server (SQLEXPRESS) as Automatic Statup (not running).  Trying to start this manually gives error 14001: "application configuration incorrect - re-install to fix" .......... Which is precisely what I'm trying to do.........:(

Network failure in Cluster Environment,will it stop the SQL Server Instances?

Hi All I have problem with cluster Environment that is there is network failure in Cluster Environment,will it stop SQL Server Instances Event viewrer Information 6:22:09 The MSSQLSERVER service entered the stopped state. 6:22:05 The MSSQLSERVER service was successfully sent a stop control. 6:22:04 The SQLSERVERAGENT service entered the stopped state. 6:21:43 The node lost communication with cluster node 'MSSQL0002' on network 'LAN'. 6:22:02 The SQLSERVERAGENT service was successfully sent a stop control. 6:22:02 Cluster resource 'SQL IP Address1(SQLCLUSTER)' in Resource Group 'SQL' failed. 6:22:02 The TCP/IP interface for Cluster IP Address 'Cluster IP Address' has failed. 6:22:02 The TCP/IP interface for Cluster IP Address 'Cluster IP Address' has failed. 6:22:02 The TCP/IP interface for Cluster IP Address 'MSDTC IP address' has failed. 6:22:02 The TCP/IP interface for Cluster IP Address 'MSDTC IP address' has failed. 6:22:02 The TCP/IP interface for Cluster IP Address 'SQL IP Address1(SQLCLUSTER)' has failed. 6:21:58 The TCP/IP interface for Cluster IP Address 'SQL IP Address1(SQLCLUSTER)' has failed. 6:21:58 Cluster network 'LAN' is operational (up). All available server cluster nodes attached to the network can communicate using it. 6:21:58 The interface for cluster node 'MSSQL0002' on network 'LAN' failed. If the condition persist

Different SQL Server instances on one server

Good afternoon. I have a Windows Server 2003 with SP2 loaded. On it I have SQL Server 2000 - 8.00.760 SP3 Developer Edition along with SQL Server 2005 - 9.00.1399.06 RTM Developer Edition. Can I also install an instance of SQL Server 2008 on this server without cauing a problem with the otherSQL instances? Thank you.

how to detect a located server

hi guys, I need your help. I did a little research to find a source that would check the proxy server whether if the server is a located at government or fbi's server, but I couldn't find it. Any info would be much appreciate. Thanks, Mark

Connect SQL Server 2005 to Ms Access on another computer

I'm trying to create a "Linked Server" on my SQL Server 2005.  This linked server is a reference to an Access File on a remote computer.  I've set up all the permissions and shared resources.  I've created an ODBC DSN to connect to the database.  If i open the DSN in excel, i can retrieve data.  If I open a linked server connected to the DB I get the following error when i try to run a query against it.   ------------------ OLE DB provider "MSDASQL" for linked server "LS_Specialty" returned message "[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed". OLE DB provider "MSDASQL" for linked server "LS_Specialty" returned message "[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed". OLE DB provider "MSDASQL" for linked server "LS_Specialty" returned message "[Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot open the file '(unknown)'.  It is already opened exclusively by another user, or you need permission to view its data.". Msg 7303, Level 16, State 1, Line 1 Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "LS_Specialty". ---------------------   Why does this DSN work in Excel and Access, but not in SQL

Linked Server to DB2 from SQL 2005 IA64BIT computer

Has anyone created a linked server to DB2 on AS/400 from SQL Server 2005 IA64 BIT? We were hoping to use the new Microsoft OLEDB Provider for DB2...The problem is the driver looks like it will only work on x64 computers."The single setup program will install the provider and tools on both x86 and x64 computers" We were able to install the driver on the IA64 computer and were able to successfully create a data source from the Data Access Tool. Oddly enough when we attempted to create a linked server in SSMS we received an error, we also noticed that the DB2OLEDB provider is not listed in SSMS. This is becoming a real problem so any ideas on how we can get this driver to work or suggestions on an alternative would be greatly appreciated.   thx.art.  

SSRS2005: Is it safe to manually remove instances from the Keys table in the report server database?

I have a problem with redundant reporting services instances still hanging around in the initialization pane of the RS configuration wizard and I can't get rid of them. The problem arose when we had new webfarms and before I had removed all references to the old ones from the initialization screen, the old webfarms had been switched off, removed from the network and dismantled. Therefore when I try to 'de-initialize' them, I get an error stating that reporting services cannot connect to them and when I run reports, a fair few are trying to run on the old webfarms which no longer exist and are disappearing into the void. There's a table in the report server database called Keys whch contains details of these intances and i'm wondering if its safe to remove these via SQL commands without breaking reporting services on other machines.   As a side note: All this stems from the fact that when you uninstall Reporting Services, not all of the files / references are removed. So as a general word of warning, if you do an uninstall of RS2005, you'll need to make sure everything's gone before re-installing, throwing away old machines etc. These include folders in IIS and these old instances as mentioned above.  

Can I have two instances (SQL 2005 - 2008) at the same server?

Hello, I have a Windows 2008 R2 with sql server 2005 x64. I would like to have both instances (SQL server 2005 x64 and 2008 x64) at the same server, each one having its own databases. Is the possible? What should I pay attention to? Thank youChristos

Accessing the command prompt of the server computer in c#

Hi ,I'm developing a web application in asp.net using  C# and need to access the command prompt of the server computer.After accessing it I need to run a "ABC.bat" file in the server computer which is in folder "E:\Test".The absolute path of the server is "\\MyServer"Any help to achieve this ( or any other alternative suggestions) would be greatly appreciated....ThanksPS: I need to run the ABC.bat file on the server machine as the bat file runs couple of more applications which are licensed to that server machine.

Rebooting one Instance on a SQL 2008 Server with multiple instances installed

Hello, Hoping someone can answer the following questions ... If I have SQL Server 2008 with multiple Named Instances configured on it, can I reboot one Named Instance without rebooting any of the other Named Instances, or without having to reboot the entire server ? For example, if I have an application that needs to be re-booted and it requires the Database to be re-booted. Regards, JD

Getting Sql Server Management Studio 2008 installed on local computer

Hello, I have been trying to figure out this problem for a while now so hopefully someone can help me out - I would really appreciate it! Right now I have SQl Server Management Studio2005 installed on my computer for a SQL sever that we have. We recently got a 2008 sql server and if I remotely access the server, I can see that SQL Management Studio 2008 has been isntalled on the new server. I need to build new databases but need SQL Management Studio 2008 on my computer and I have no idea how to get it. I have a "Microsoft SQl Server 2008 R2" folder on my computer, and I have already tried clicking on "Configuration Tools" and then "SQL Server Installation center" and it isntalls a bunch of things, but none of them are "SQL Server Management Studio 2008."  I also found a link on a Microsoft website that says it's SQL Server Management studio 2008 R2 but it was just the same bunch of programs I already downloaded. How do I install Sql Server Managment Studio 2008 on my computer?! Thanks in advance for any help you can provide.

Failure to Install SQL Server 2005 on XP Computer with Service Pack 3

I have tried multiple times to Install Business Contact Manager (Office Small Business 2007). Each time the installation fails because it can not complete installation of SQL Servier 2005. Here's the log with the failed component in BOLD: Microsoft SQL Server 2005 9.00.3042.00 ============================== OS Version      : Microsoft Windows XP Professional Service Pack 3 (Build 2600) Time            : Sat Sep 11 16:11:50 2010   Machine         : REF1 Product         : Microsoft SQL Server Setup Support Files (English) Product Version : 9.00.3042.00 Install         : Successful Log File        : C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\LOG\Files\SQLSetup0009_REF1_SQLSupport_1.log -------------------------------------------------------------------------------- Machine         : REF1 Product         : Microsoft SQL Server Native Client Product Version : 9.00.3042.00 Install         : Successful Log File        : C:\Program Files\Microsoft SQL Server\90\Setup Bo

Does "Microsoft OLE DB Provider for SQL Server" get different versions for SQL2005 and SQL2008?

We know SQLServer OLE DB have two driver types: SQL Native Client and Microsoft OLE DB Provider. I know The former one have different versions for SQLServer2005 and SQLServer 2008 (SQLNCLI.DLL, SQLNCLI10.DLL), right? And for latter one, does it have different versions? I only got SQLOLEDB.dll under system32 folder, but have no idea whether it have different versions. Can some one help me?   Thanks Spring  

Installing multiple instances of SQL Server R2 creates permissions issues - first instance won't st

After installing two named instances of SQL Server 2008 R2 DataCenter edition (R2D2 and C3P0) I found the first instance would no longer start.  The errorlog showed the reason to be an invalid path. 2010-09-14 18:15:39.12 Server      Error: 17113, Severity: 16, State: 1. 2010-09-14 18:15:39.12 Server      Error 3(The system cannot find the path specified.) occurred while opening file 'C:\MSSQL\SQLDAT\MSSQL10_50.R2D2\MSSQL\DATA\master.mdf' to obtain configuration information at startup. An invalid startup option might have caused the error. Verify your startup options, and correct or remove them if necessary. Finding the files in the proper location I check the ACLs and found the Local Group created for the second instance on the ACL for the first instance.  That is to say for instance R2D2 I found MSP-JANHONJ7\SQLServerMSSQLUser$MSP-janhonj7$C3P0 instead of the MSP-JANHONJ7\SQLServerMSSQLUser$MSP-janhonj7$R2D2 that was originally there. C:\MSSQL\SQLDAT\MSSQL10_50.R2D2\MSSQL\DATA>icacls master.mdf master.mdf NT AUTHORITY\SYSTEM:(F)            BUILTIN\Administrators:(F)            MSP-JANHONJ7\SQLServerMSSQLUser$MSP-janhonj7$C3P0:(F) It seems that creating the second instance causes this problem.  I have been u

bootstrapping config process when there are two instances on server!


Have a package (several actually) that first reads c:\apps\config\mypackage.dtsconfig.  This sets the servername and catalog for my database and the main bunch of config values from an SSISConfigurations table.  Let's make believe we just *have* to use that table to hold the real config values.  Well, this all worked fine until they decided to put a second "test" environment on the dev server.  When a package is loaded in the test environment, it should use the test instance, etc.  But it shares the c:\apps\config folder with the other instance!  So now, I have trouble (at least) bootstrapping the configs into the proper environment.  This is SQL 2008, btw, which seems to be extremely important as to the order in which configs are applied.


Has anybody dealt with this?

I think I can squeeze through here as long as I only have to finagle this in dev/test, and production only has a single instance.  Do you see why?

Of course the goal here is to let the package configure correctly without opening it up and changing stored values just to move between environments.

Help!  and TIA,


ps - yes it would be nice if you could put a "p

Problems to connect to sharepoint server from another computer



recently i developed a webservice in Visual Studio 2008 that connects to Microsoft office sharepoint server 2007, i've already have both the WS and the SharePoint server deployed in the same IIS, and when i create a client to that webservice that its on the same machine that the iis, it works perfectly.


but the problem comes when i run this client from a different instance or machine, i'm not able to connect to the SharePoint server, i'm wondering if there is a configuration that i'm missing.


this is my web.config from my webservice:


<?xml version="1.0"?>


    Note: As an alternative to hand editing this file you can use the 

    web admin tool to configure settings for your application. Use

    the Website->Asp.Net Configuration option in Visual Studio.

    A full list of settings and comments can be found in 

    machine.config.comments usually located in 





        <sectionGroup name="system.we

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend