Get Windows Edition information from SQL Server
- One way is to extract from @@VERSION.
- Another way is to use exec master..xp_cmdshell ’systeminfo’
- One more way will be to use a CLR Function (or stored procedure). Sample below:
using System; using System.Data; using System.Data.SqlClient; using System.Data.SqlTypes; using Microsoft.SqlServer.Server; public partial class UserDefinedFunctions { [Microsoft.SqlServer.Server.SqlFunction] public static SqlString Function1() { return new SqlString(System.Environment.OSVersion.ToString()); } };
It should output something like this:
SELECT dbo.Function1()
>> Microsoft Windows NT 6.0.6001 Service Pack 1
Related posts:























Leave a Reply
You must be logged in to post a comment.