Scripts

Technical Article

Drop all Connections from a Database

On development servers, at times there is a need for dropping and renaming database(s). These scripts can be used for achieving these tasks. The usp_DropDB script will kill the connections to the database and then drop the database. It takes care of the space in the database name, if any and also makes sure that […]

5 (2)

You rated this post out of 5. Change rating

2001-08-08

5,315 reads

Technical Article

Kill All Users in A Given Database

This script will kill all users in a given database. Before disconnecting, it can optionally send the user a NET SEND Message giving them a warning to disconnect. To run, simply call it like usp_killusers 'dbname'. Make sure the @dbname parameter is not the master database.

4.17 (6)

You rated this post out of 5. Change rating

2001-08-08

4,412 reads

Technical Article

Quickly Enable/Disable Triggers and Constraints

When loading data, nothing can be more frustrating than having to deal with stubborn constraints and triggers. This is especially true when you know your data is fine but the constraints are too prohibitive for a mass initial load. Here's a technique I use to disable the constraints and triggers temporarily during a mass load. […]

5 (1)

You rated this post out of 5. Change rating

2001-08-08

3,024 reads

Blogs

A First Look at Redgate’s Subsetter

By

I have been a proponent of subsetting databases in dev/test for a long time....

Azure SQL MI License free?

By

A common setup when leveraging the cloud is to use the cloud for Disaster...

Foreign Keys in SQL Data Generator

By

A customer recently asked about using FKs in SQL Data Generator, and I decided...

Read the latest Blogs

Forums

SQL query i need each Friday count back 6 days and select each ticker record

By angang

I have a stock market table that includes 70 tickers per day: ticker date,...

If anyone used tools like Gee-Pee-Tee for writing T-SQL (MS SQL server)?

By VAI

If anyone used artificial intel like Gee-Pee-Tee for writing T-SQL (MS SQL server) code...

Syntax Problem

By charliedurnin@gmail.com

I think that I am almost there but I am getting one red squiggle...

Visit the forum

Question of the Day

Query Execution Modes

What are the two distinct processing modes that the SQL Server Database Engine can use to process T-SQL statements?

See possible answers