|
|
Browse by Tags
All Tags » SQL Server » tsql
Showing page 1 of 2 (17 total posts)
-
Best Practices are good enough to follow, but simply do not read and digest. Try to implement them within your environment to keep up the performance. Similary there are many things involved within the SQL Server 2005 Analysis Services such as MDX queries, data mining etc. For any sort of performance analysis exercise you must identify the ...
-
You may be aware the DML and DDL triggers can be nested up to 32 levels, because any reference to such trigger code counts as one-level in the nesting limit. Even though it is possible to control whether AFTER triggers can be nested through the nested triggers server configuration option. So how it can be escaped using CLR and how procedural and ...
-
When I'm performing a performance analysis on a 24/7 application and dealing with PSS I had been given the following TSQL to identify the long running queries against a database. select r.session_id, s.host_name, s.program_name, s.host_process_id, r.status, r.wait_time,wait_type,r.wait_resource, substring(qt.text,(r.statement_start_offset/2) +1, ...
-
Cursors are based for a definitive purpose, but heavy usage of such methods will prove as costly expense on database performance. The process of cursor is prolonged, as a cursor first has to be defined with its features set, then populated after positioning (scrolled) to a set of record(s) and fetched every time. Finally once the process is ...
-
The following pages were recently modified. Source: Knowledge Base Product: Microsoft SQL Server 2005 Enterprise Edition, SQL Server 2005 Standard Edition & SQL Server 2005 Enterprise X64 Edition Notification Contents: New and Major Modifications FIX: Error message when you run a stored procedure that starts a transaction that contains a ...
-
For SQL Server 2000 version: SELECT S2.[name] TableName, S1.[name] TriggerName, CASE WHEN S2.deltrig = s1.id THEN 'Delete' WHEN S2.instrig = s1.id THEN 'Insert' WHEN S2.updtrig = s1.id THEN 'Update' END 'TriggerType' , 'S1',s1.*,'S2',s2.* FROM sysobjects S1 JOIN sysobjects S2 ON S1.parent_obj = S2.[id] WHERE S1.xtype='TR' For SQL Server 2005 ...
-
As you may aware the PERFMON (SYSMON) utility provides much information to analyze on the systems resource usage, I support and suggest to make use of this tool as much as you can with a default templates within our environment. You may be aware the data is saved as a file with .BLG extension which can be opened again using this SYSMON tool. I ...
-
SELECT DB_NAME(database_id) AS 'DatabaseName' , mirroring_role_desc , mirroring_safety_level_desc , mirroring_state_desc , mirroring_safety_sequence , mirroring_role_sequence , mirroring_partner_instance , mirroring_witness_name , mirroring_witness_state_desc , mirroring_failover_lsn FROM sys.database_mirroring WHERE mirroring_guid IS NOT NULL; ...
-
select p . state_desc + ' ' + p . permission_name + ' OBJECT::' + s . name collate Latin1_general_CI_AS + o . name collate Latin1_general_CI_AS + ' TO ' + u . name collate Latin1_general_CI_AS + 'GO' , p .* from sys.database_permissions p inner join sys.objects o on p . major_id = o . object_id inner join sys.schemas s on s . schema_id = o . ...
-
Jeff Smith in his weblog showed how to generate Crosstab reports using a stored procedure. I had a requirement to generate crosstab reports with more than one pivot column. So I used the same approach he used and modified his procedure as shown below CREATE procedure CrossTab ( @select varchar(2000), @PivotCol varchar(100), @Summaries ...
1
|
|
|