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 […]

(2)

You rated this post out of 5. Change rating

2001-08-08

5,496 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.

(6)

You rated this post out of 5. Change rating

2001-08-08

4,521 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. […]

(1)

You rated this post out of 5. Change rating

2001-08-08

3,112 reads

Blogs

T-SQL Tuesday #202: 100 Hours

By

It’s time for T-SQL Tuesday again and this is a great prompt to start...

T-SQL Tuesday

By

T-SQL Tuesday is a monthly blog party hosted by a different community member each...

Exploring DiskANN: Part 2: PQ, SSDs, caching and beam search

By

How I used AI for this postChatGPT to generate images based on info specifically...

Read the latest Blogs

Forums

Alamat BCA KCP Menara Imperium Telp:0821-8200-233

By layanan_Bca88

Telp/Wa 62 821-8200-233 Jl. H. R. Rasuna Said No.Kav. 01, RW.6, Guntur, Kecamatan Setiabudi,...

Alamat BCA KCP Sejati Mulia Telp:0821-8200-203

By m4rt1n4

Telp/Wa 62 821-8200-203 Koperasi Sejati Mulia, Jl. Raya Ragunan B 1, RT.3/RW.3, Jati Padang,...

Alamat BCA KCP Graha Inti Fauzi Telp:0821-8200-174

By R4nt4u

Telp/Wa 62 821-8200-174 Gd. Graha Inti Fauzi, Jl. Buncit Raya No.22 Lt. Dasar, RT.2/RW.7,...

Visit the forum

Question of the Day

RegEx Functions II

I have this data in a table in a SQL Server 2025 database:

EmailAddressID EmailAddress
7              dylan0@ADVENTURE-WORKS.COM
8              Diane1@ADVENTURE-WORKS.COM
If I run this query, which row(s) are returned?
SELECT top 10
 *
 FROM person.EmailAddress
 WHERE REGEXP_LIKE(EmailAddress, '^d')
 AND BusinessEntityID IN (7,8)

See possible answers