Search code examples
sqlsql-serversmo

Programmatically detect SQL Server Edition


I'm using C# with SMO and attempting to detect what edition of SQL Server (e.g., enterprise, standard) I'm connecting to. I know how to get the version information, but that only tells me what version of SQL Server (e.g., SQL Server 2008 vs SQL Server 2005).

Does anyone know how to get the actual product edition (e.g., enterprise, standard)?

I need this information because some SQL Server features are only enterprise. Thus, I could just try to call them and catch the exception, but I'd much prefer an upfront detection.

Thanks!


Solution

  • It looks like you might be able to do it via SMO and the Server object. There are properties like Information.Edition which looks like it should do what you want.