Thursday, April 14, 2011

Detect if SQL Server is an Azure Edition by using SQL command?

Easy to do:
DECLARE @edition sysname;
SET @edition = cast(SERVERPROPERTY(N'EDITION') as sysname);
select case when @edition = N'SQL Azure' then 1 else 0 end as 'IsCloud'

It just return 0 or 1 to detect if SQL is an Azure edition

No comments:

Post a Comment