SQL Server Find What Jobs Are Running a Procedure

This will capture instances where the procedure is explicitly referenced in the job step: DECLARE @s nvarchar(255) = N’procedure_name’; SET @s = QUOTENAME(@s, nchar(37)); SELECT job_name = j.name, s.step_id, s.step_name, j.date_created, j.date_modified FROM msdb.dbo.sysjobs AS j INNER JOIN msdb.dbo.sysjobsteps AS s ON j.job_id = s.job_id WHERE s.command LIKE @s OR j.name LIKE @s OR s.step_name … Read more

SQL Server Connection Strings – dot(“.”) or “(local)” or “(localdb)”

. and (local) and YourMachineName are all equivalent, referring to your own machine. (LocalDB)\instance is SQL Server 2012 Express only. The other parts are depending on how you install – if you install with an instance name – then you need to spell that instance name out (SQL Server Express by default uses the SQLEXPRESS … Read more

Collation Error

Need to set it to SINGLE_USER first. ALTER DATABASE [database] SET SINGLE_USER WITH ROLLBACK IMMEDIATE; GO ALTER DATABASE [database] COLLATE SQL_1xCompat_CP850_CI_AS; GO ALTER DATABASE [database] SET MULTI_USER; GO