Skip to content

Instantly share code, notes, and snippets.

@sqlstudent144
sqlstudent144 / sp_SrvPermissions.sql
Last active December 24, 2023 20:43
sp_SrvPermissions
USE master
GO
IF OBJECT_ID('dbo.sp_SrvPermissions') IS NULL
EXEC sp_executesql N'CREATE PROCEDURE dbo.sp_SrvPermissions AS PRINT ''Stub'';'
GO
/*********************************************************************************************
sp_SrvPermissions V6.1
Kenneth Fisher
http://www.sqlstudies.com
@alexsorokoletov
alexsorokoletov / Helpers.sql
Last active February 9, 2022 08:00
Helpful functions when you need to find out what is going on on SQL Server
/* TOP SLOW REQUESTS */
/* time is in microseconds */
SELECT creation_time
,last_execution_time
,total_physical_reads
,total_logical_reads
,total_logical_writes
, execution_count
, total_worker_time
, total_elapsed_time