create table #SVer(ID int,  Name  sysname, Internal_Value int, Value nvarchar(512))	insert #SVer exec master.dbo.xp_msver
declare @SmoRoot nvarchar(512)
exec master.dbo.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SOFTWARE\Microsoft\MSSQLServer\Setup', N'SQLPath', @SmoRoot OUTPUT

SELECT 
serverproperty('ComputerNamePhysicalNetBIOS') as HostName,
serverproperty(N'Servername') AS [Instance_Name],
(select Value from #SVer where Name = N'ProductName') AS [Product],
CAST(SERVERPROPERTY(N'Edition') AS sysname) AS [Edition],
SERVERPROPERTY(N'ProductVersion') AS [VersionString]


drop table #SVer

