join the MSSQLTips community

Today's Site Sponsor


 

SQL Compare quickly and easily compares and synchronizes SQL Server database schemas
 



I generated better data in only seconds...

SQL Server Instance Objects

Written By: Jeremy Kadlec -- 8/15/2006 -- read/post comments -- print -- Bookmark and Share

Rating: (not rated yet) Rate

Problem
When it comes time to review server related information from your SQL Server be sure to know how and where to access the information.  With SQL Server 2005 some of the resources have changed and new resources have popped up.  This tip outlines core server related information from SQL Server 2000 to 2005.

Solution
Mapping server information between SQL Server 2000 and 2005 is critical to ensure scripts are working properly when upgrading to SQL Server 2005. Below outlines the common server related objects.

ID Information SQL Server 2000 SQL Server 2005
1 System table\view with all server related information for the local, remote and linked servers SELECT *
FROM master.dbo.sysservers
GO
SELECT *
FROM master.sys.servers;
GO
 
2 General SQL Server metrics for 1 server sp_helpserver 'ProdSQL1'
GO
 
sp_helpserver 'ProdSQL1';
 
3 Listing of the server wide configurations sp_configure
GO
 
EXEC sp_configure;
4 Configures server options for remote or linked servers sp_serveroption 'ProdSQL1', 'collation compatible', TRUE
GO
 
sp_serveroption 'ProdSQL1', 'collation compatible', TRUE;
5 System function returning server information such as the collation, edition, instance name, security configuration, etc. for the SQL Server SELECT SERVERPROPERTY('Edition')
GO
 
SELECT SERVERPROPERTY('Edition');
6 Approximately 30 connection related parameters primarily for ODBC EXEC sp_server_info
GO
 
EXEC sp_server_info;
7 Function to return the SQL Server instance name SELECT @@SERVERNAME
GO
 
SELECT @@SERVERNAME;
8 System stored procedure to return the sort order and character set for the SQL Server sp_helpsort
GO
 
EXEC sp_helpsort;
9 Listing of the active processes sp_who2 active
GO
 
EXEC sp_who2 active;
 
10 System table\view with real time system processes in SQL Server whether the process (spid) is active, sleeping, etc. SELECT *
FROM master.dbo.sysprocesses
GO
 
SELECT * FROM sys.dm_exec_sessions;
GO

SELECT * FROM sys.dm_exec_connections;
GO
 

Next Steps

Readers Who Read This Tip Also Read Free Live Webcast Comment or Ask Questions About This Tip


Sponsor Information
Free SQL Server performance monitoring dashboard – Idera SQL check

Try SQL Object Level Recovery Native from Red Gate to save time and disk space. Download a free trial.

SQL Server Issues? Not sure where to turn for answers? Innovative SQL DBA consultants

Stop here to prepare for your next SQL Server interview!

Free whitepaper - Developing Something for Nothing with SQL Server: A Closer Look at SQL Server Express


Get Our Tips Newsletter

We keep 50,000+ SQL Server professionals informed.

Red Gate Software - SQL Compare

Quickly and accurately deploy database changes with Red Gate’s SQL Compare. 2/3 of people who use a SQL comparison tool use Red Gate’s SQL Compare – the industry standard database comparison and deployment tool. “We rely on SQL Compare for every deployment.” Paul Tebbut, Technical Lead, Universal Music Group

Download now!



More SQL Server Tools
SQL secure

SQL Refactor

SQL Backup

SQL defrag manager

SQL comparison toolset




Copyright (c) 2006-2010 Edgewood Solutions, LLC All rights reserved
privacy statement | disclaimer | copyright | advertise | write for mssqltips | feedback | about
Some names and products listed are the registered trademarks of their respective owners.


CareerQandA.com | MSSharePointTips.com | MSSQLTips.com