Situatie
Mai jos aveti o procedura care rulata pe serverul de sql returneaza numele serverului, versiunea de sql instalata pe server, ultimul service pack de sql instalat precum si ultimul restart al serverului de sql.
Solutie
create procedure SqlServer_prc
as
declare @LastRestart datetime
select @LastRestart = create_date from sys.databases where database_id = 2
SELECT
@@servername as ServerName,
substring(@@version,1,charindex(‘-‘,@@version)-1)
+convert(varchar(100),SERVERPROPERTY(‘edition’)) ServerEdition,
convert(varchar(100),SERVERPROPERTY(‘productlevel’)) as ServicePack,
@LastRestart as LastRestart
Leave A Comment?