SQL Server Table Smells – Simple-Talk

Here is the corrected version of Phil’s table smell:Note: This needs to be run per database. create proc dbo.sp_CodeSmellsas;WITH TableSmells (TableName, Problem, Object_ID )AS(SELECT object_schema_name(Object_ID)+’.’+object_name(Object_ID), Problem,Object_ID FROM ( SELECT object_id, ‘wide (more than 15 columns)’ FROM sys.tables /* see whether the table has more than 15 columns */ WHERE max_column_id_used>15 UNION ALL SELECT DISTINCT sys.tables.object_id,… Continue reading SQL Server Table Smells – Simple-Talk

Stored Procedure script to show all jobs

USE [master]GO create proc [dbo].[sp_ShowJobs]asSELECT j.name AS ‘Job’, *FROM msdb.dbo.sysschedules schedJOIN msdb.dbo.sysjobschedules jsched ON sched.schedule_id = jsched.schedule_idJOIN msdb.dbo.sysjobs j ON jsched.job_id = j.job_id GO