Friday, 5 April 2013

DBA Concepts



How to update statistics which are outdated?
--- updating usage statistics on SQL Server
EXEC sp_updatestats

------------------------------------------------------------------------------------------------------------------------------------------
How to identify the current SQL version on the server?

SELECT
          SERVERPROPERTY('MachineName') as Host,
          SERVERPROPERTY('InstanceName') as Instance,
          SERVERPROPERTY('Edition') as Edition, /*shows 32 bit or 64 bit*/
          SERVERPROPERTY('ProductLevel') as ProductLevel, /* RTM or SP1 etc*/
          Case SERVERPROPERTY('IsClustered') when 1 then 'CLUSTERED' else
      'STANDALONE' end as ServerType,
          @@VERSION as VersionNumber         

------------------------------------------------------------------------------------------------------------------------------------------
How to retrieve the configuration paramaters in SQL Server 2005?

'SELECT * from sys.configurations order by NAME
or
SP_CONFIGURE 'show advanced options',1
go
RECONFIGURE with OVERRIDE
go
SP_CONFIGURE
Go

No comments:

Post a Comment

How to find out recent differential backup history in SQL Server

-- Get Backup History for required database SELECT TOP 100 s.database_name, m.physical_device_name, CAST(CAST(s.backup_size / 1000000...