Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / DB Engine / SQL Server / March 2008

Tip: Looking for answers? Try searching our database.

Determine if MSDE or SQL Express is installed?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark Lemoine - 10 Mar 2008 21:28 GMT
Is there a best practice in determining whether MSDE installed on a
workstation or if SQL Express is installed?  The SQL Express installs
are all with the default named instance of .\SQLExpress, but it's not
otherwise generally known as to which version is present.

Specifically, a (DOS) bat file is periodically launched to run a sql
script (via osql.exe).  Somehow, the bat file needs to handle the
difference between the MSDE default instance and the SQL Express named
instance.

I thought of using the installed paths to make a decision in the bat
file, for instance:

IF EXIST "C:\Program Files\Microsoft SQL Server\90" GOTO :Express
:MSDE
osql.exe -S (local) -E -i myfile.sql -n
GOTO :EOF
:Express
osql.exe -S .\SQLExpress -E -i myfile.sql -n

('Course the second osql.exe reference above could be to sqlcmd.exe
instead).

Thanks!
John Bell - 11 Mar 2008 09:50 GMT
Hi Mark

SQLPing will give you a list of instances but not the information on
editions see
http://www.sqlsecurity.com/Tools/FreeTools/tabid/65/Default.aspx

You could use SMO, sqlcmd or osql to get the edition information

SERVERPROPERTY ( 'edition')
or
SERVERPROPERTY ( 'Engine Edition' )

but you would need to connect to it to be able to query the server properties.

John

> Is there a best practice in determining whether MSDE installed on a
> workstation or if SQL Express is installed?  The SQL Express installs
[quoted text clipped - 20 lines]
>
> Thanks!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.