Home » Posts tagged 'SQL Server' (Page 7)

Tag Archives: SQL Server

How to find current/particular transaction level?

There is 2 ways of finding current / particular transaction level :- 1) SELECT CASE transaction_isolation_level WHEN 0 THEN ‘Unspecified’ WHEN 1 THEN ‘ReadUncomitted’ WHEN 2 THEN ‘Readcomitted’ WHEN 3 THEN ‘Repeatable’ WHEN 4 THEN ‘Serializable’ WHEN 5 THEN ‘Snapshot’ END AS TRANSACTION_ISOLATION_LEVEL FROM sys.dm_exec_sessions where session_id = @@SPID 2) DECLARE @UserOptions TABLE(SetOption varchar(100), Value … Continue reading

Script to get details of permissions on Database objects

Script to get details of permissions on Database objects Script to get details of permissions on Database objects SELECT [UserName] = ulogin.[name], [UserType] = CASE princ.[type] WHEN ‘S’ THEN ‘SQL User’ WHEN ‘U’ THEN ‘Windows User’ WHEN ‘G’ THEN ‘Windows Group’ END, [DatabaseUserName] = princ.[name], [Role] = null, [PermissionType] = perm.[permission_name], [PermissionState] = perm.[state_desc], [ObjectType] … Continue reading

Query Execution Plan from XML to Graphical View

Convert Your SQL Server Query Execution Plan from XML to Graphical View 1) We can get queries execution plan from below query SELECT QS.*, CP.* FROM SYS.DM_EXEC_QUERY_STATS AS QS CROSS APPLY SYS.DM_EXEC_SQL_TEXT(SQL_HANDLE)AS ST CROSS APPLY SYS.DM_EXEC_QUERY_PLAN(PLAN_HANDLE) AS CP 2) Column query_plan is having execution plan in XML form 3) When we click hyperlink in query_plan … Continue reading

%d bloggers like this: