Posts

Showing posts from July, 2013

static port

How to Configure static ports for SQL Server If a SQL Server instance is configured with a static port , SQL Server only listens on the specified static port. But it is important to delete all entries for dynamic ports otherwise SQL Server will listen on the static and dynamic ports.  Use Configure a Server to Listen on a Specific TCP Port (SQL Server Configuration Manager)  http://msdn.microsoft.com/en-us/library/ms177440.aspx Follow these details to the letter. Failure to follow the details – can leave a situation where the SQL Server is listening to the static and dynamic ports. Notes on configuring a static port for SQL Server 1)     If you want to use just a static port , clean up the entry for the dynamic port . If the dynamic port entry is not cleared , the setting  continues to be used. You can easily verify  by use the  sys.tcp_endpoints view . view source print ? 1. SELECT    ...

highest CPU queries

select      highest_cpu_queries.plan_handle,      highest_cpu_queries.total_worker_time,     q.dbid,     q.objectid,     q.number,     q.encrypted,     q.[text] from      (select top 50          qs.plan_handle,          qs.total_worker_time     from          sys.dm_exec_query_stats qs     order by qs.total_worker_time desc) as highest_cpu_queries     cross apply sys.dm_exec_sql_text(plan_handle) as q order by highest_cpu_queries.total_worker_time desc

Get Table Space Useage for a specific schema

/****************************************************************************** **    File: “GetTableSpaceUseage.sql” **    Name: Get Table Space Useage for a specific schema **    Auth: Robert C. Cain **    Date: 01/27/2008 ** **    Desc: Calls the sp_spaceused proc for each table in a schema and returns **        the Table Name, Number of Rows, and space used for each table. ** **    Called by: **     n/a – As needed ** **    Input Parameters: **     In the code check the value of @schemaname, if you need it for a **     schema other than dbo be sure to change it. ** **    Output Parameters: **     NA *******************************************************************************/ /*—————————————————————————*/ /* Drop the temp table if it's there from a previous run                 ...