Lock and Connection Management

Technical Article

Correction to "drop/recreate objects" script.

  • Script

Regarding the recent script I submitted (dropping/recreating all procedures/views) - I made an important oversight. I neglected to add a CASE statement in order to make sure that the appropriate type of object was being referenced in the DROP statement.Below is the corrected script:

5 (1)

You rated this post out of 5. Change rating

2003-02-06

202 reads

Technical Article

Drop and re-create all stored procedures or views

  • Script

There are times when you may need to drop and re-create all stored procedures and/or views in your database.  For example, in cases where procedures or views are causing blocked locks or other performance problems, a recent article (http://www.sswug.org/see.asp?s=1166&id=13448) suggested dropping/re-creating procedures and views after a service pack has been installed.  The installation of a […]

1.67 (3)

You rated this post out of 5. Change rating

2003-02-05

1,226 reads

Technical Article

SP to display locking users in tree format

  • Script

This SP will give a listing of users blocking and being blocked in a tree formation (similar to explorer tree list). It uses a User defined function that recurses through the locking information gathered from sysprocesses. The listing only shows the Hostname (username) and the SPID.First create the User Defined Function (Part One) then create […]

2 (1)

You rated this post out of 5. Change rating

2002-08-19

2,106 reads

Technical Article

System Lock Snapshot

  • Script

This script captures the current system lock in a temp table, then builds a temp translation table for database and object id by iterating through all of the databases.  It then produces a report by joining the two tables.For better performance, you could make the translation table perminante and only update it when you are […]

You rated this post out of 5. Change rating

2002-06-14

570 reads

Technical Article

sp_lock2  = sp_lock +shows database and object name

  • Script

sp_lock2 is similar to sp_lock, except that it displays the database name, object name and index name instead of the ids.  It accepts no parameters unlike the sp_lock procedure which can take an optional spid parameter. The basis for the main query which queries the system tables for lock info was taken from the sp_lock […]

4.5 (2)

You rated this post out of 5. Change rating

2002-06-06

3,808 reads

Technical Article

Alert Procedure for Long-Running Job

  • Script

For jobs that run periodically and should take only a short time to run, a DBA may want to know when the job has been running for an excessive time. In this case, just checking to see IF the job is running won't do; the ability to make sure that it hasn't been running for […]

4.8 (5)

You rated this post out of 5. Change rating

2002-01-15

3,971 reads

Blogs

The Basics of TRY CATCH Blocks–#SQLNewBlogger

By

I was working with a customer and discussing how to do error handling. This...

Working with ALS – Insights from the Ability Summit

By

The 14th annual Ability Summit is a global event that I attended a few...

Apr 9 Webinar: Accelerating Success: De-risking and Streamlining Releases with Flyway Enterprise

By

UPDATE: This moved to Apr 9 Join me Tuesday, Apr 9 for a webinar,...

Read the latest Blogs

Forums

Botched "Data warehouse" design...

By pietlinden

Someone landed a PowerBI mess in my lap, and near as I can tell,...

disaster recovery

By sqlfriend

We have two data centers in same city. One is our main site, the...

Set up Availability Group without a cluster to create read-only database

By koln

I want to have a a secondary ready-only database available for reporting, which is...

Visit the forum

Question of the Day

Backing up the Resource Database

How does the Resource database in SQL Server 2022 get backed up?

See possible answers