Scripts

Technical Article

Email using CDONTS (via smtp)

Here is a very basic example script for sending emails via CDONTS. This comes from the sqlmag web-site forum. Although fine, remember that it will use the local SMTP server to forward emails onto the destination user. If your servers smtp process can not reach an exchange/group-wise/other mail box on your network, then this code […]

You rated this post out of 5. Change rating

2001-08-09

3,536 reads

Technical Article

Generate Insert Statements Easily

This script will generate insert statements for the given tables. You can pass the tables names, separated by commas, into sp_DataAsInsCommand stored procedure as in the example below: EXEC sp_DataAsInsCommand 'employee,titleauthor,pub_info' Updated on 5/25/01 to correct an issue with columns that are short like a column defined as char(1), to correct another issue with the […]

3 (9)

You rated this post out of 5. Change rating

2001-08-09

4,618 reads

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,201 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,388 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,015 reads

Blogs

Summit Launch Pricing Ends June 7

By

The PASS Data Community Summit is back in Seattle this November, the 14-17, 2023....

Masking Columns in Azure SQL and SQL Server: Safeguarding Sensitive Data

By

Information security and privacy are key in today’s data-driven world. Sensitive data needs to...

Tales From The Field Weekly Wrap Up for the Week of 05-22-2023 Microsoft Fabric Launch & Moving Home Offices

By

 Hello Dear Reader!  Sorry this is so late, moving houses has gotten me a...

Read the latest Blogs

Forums

Not wanting to use a Cursor, but...

By jwilkerson@valleymetro.org

Ok, need someone to talk me off the cursor ledge on this one. I...

Better Communication Through Less Messaging

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Better Communication Through Less Messaging

MuleSoft Integration with Azure Key Vault

By Sukanya Konatam

Comments posted to this topic are about the item MuleSoft Integration with Azure Key...

Visit the forum

Ask SSC Logo Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers