Hello my name is Itay Levi and this is my first blog ever.
As a true SQL geek I will try to post some new and neat t-sql scripts i ran into in my day job as a software engineer, hope you like it and of course don't forget to leave some comments
I would like to start with a really easy t-sql i needed the other day just to get some information about my mssql server, this one will Display the
MachineName, ProductVersion, ProductLevel, Edition, EngineType and LicenseType
Enjoy and wait for more to come soon :)
SELECT CAST( SERVERPROPERTY( 'MachineName' ) AS varchar( 30 ) ) AS MachineName , CAST( SERVERPROPERTY( 'InstanceName' ) AS varchar( 30 ) ) AS Instance , CAST( SERVERPROPERTY( 'ProductVersion' ) AS varchar( 30 ) ) AS ProductVersion , CAST( SERVERPROPERTY( 'ProductLevel' ) AS varchar( 30 ) ) AS ProductLevel , CAST( SERVERPROPERTY( 'Edition' ) AS varchar( 30 ) ) AS Edition , ( CASE SERVERPROPERTY( 'EngineEdition') WHEN 1 THEN 'Personal or Desktop' WHEN 2 THEN 'Standard' WHEN 3 THEN 'Enterprise' END ) AS EngineType , CAST( SERVERPROPERTY( 'LicenseType' ) AS varchar( 30 ) ) AS LicenseType , SERVERPROPERTY( 'NumLicenses' ) AS #Licenses;
As a true SQL geek I will try to post some new and neat t-sql scripts i ran into in my day job as a software engineer, hope you like it and of course don't forget to leave some comments
I would like to start with a really easy t-sql i needed the other day just to get some information about my mssql server, this one will Display the
MachineName, ProductVersion, ProductLevel, Edition, EngineType and LicenseType
Enjoy and wait for more to come soon :)
SELECT CAST( SERVERPROPERTY( 'MachineName' ) AS varchar( 30 ) ) AS MachineName , CAST( SERVERPROPERTY( 'InstanceName' ) AS varchar( 30 ) ) AS Instance , CAST( SERVERPROPERTY( 'ProductVersion' ) AS varchar( 30 ) ) AS ProductVersion , CAST( SERVERPROPERTY( 'ProductLevel' ) AS varchar( 30 ) ) AS ProductLevel , CAST( SERVERPROPERTY( 'Edition' ) AS varchar( 30 ) ) AS Edition , ( CASE SERVERPROPERTY( 'EngineEdition') WHEN 1 THEN 'Personal or Desktop' WHEN 2 THEN 'Standard' WHEN 3 THEN 'Enterprise' END ) AS EngineType , CAST( SERVERPROPERTY( 'LicenseType' ) AS varchar( 30 ) ) AS LicenseType , SERVERPROPERTY( 'NumLicenses' ) AS #Licenses;
No comments:
Post a Comment