Click here to Skip to main content
15,891,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

How can i check if installed version of SQL (in local system) is express edition or enterprises edition?

Thank you all in advance.
Posted

Try

SQL
SELECT @@VERSION

or for SQL Server 2000 and above the following is easier to parse :)
SQL
SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY('productlevel'), SERVERPROPERTY('edition')


For more Click here[^]

[EDIT]

Using c#: Check this answer[^]
 
Share this answer
 
v2
Comments
vidiking 26-Apr-12 3:04am    
Can I check it problematically by using c# code?
Prasad_Kulkarni 26-Apr-12 3:07am    
Please see my updated answer.
Hi,

Try this :
SQL
SELECT ServerProperty('edition') AS 'SQL Server Instance'
 
Share this answer
 
Comments
vidiking 26-Apr-12 4:51am    
But how can i execute this in C# and collect the result?
Deepak_Sharma_ 26-Apr-12 4:58am    
You can use SqlCommand.ExecuteScalar():

string constring = ConfigurationManager.ConnectionStrings["ConString2"].ToString();
SqlConnection connection = new SqlConnection(constring);
SqlCommand cmd = new SqlCommand("SELECT ServerProperty('edition') AS 'SQL Server Instance'", connection);
connection.Open();
string InstanceName = string.Empty;
if (cmd.ExecuteScalar() != null)
{
InstanceName = cmd.ExecuteScalar().ToString();
}
connection.Close();
vidiking 26-Apr-12 5:11am    
Thank you deepak. Its working fine.
Deepak_Sharma_ 26-Apr-12 5:15am    
You should click on the green button "Accept Solution" if it helped you
Prasad_Kulkarni 27-Apr-12 1:41am    
Good answer Deepak +5!
If you are using Mgmt Studio
Go to Menu
=>Help
=>About
 
Share this answer
 
Use the following commands in osql or Management Studio:

SQL
SELECT @@version

SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900