Scripts

Optimize Character Field Usage

This stored procedure was designed to scan all your character based columns in a particular database and show the minimum, maximum and average data length. As well as give an efficiency rating of the data stored. Input: None Output: Table name, Column name, Defined datatype and length, Average length of data for that column, Minimum […]

2001-08-10

1,658 reads

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

2001-08-09

3,521 reads

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)

2001-08-09

4,597 reads

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)

2001-08-08

4,806 reads

Blogs

P2 Puts Easy, Flexible Project Tracking Tools In Your Hands

By

Improve your team's workflow and productivity with these project tracking blocks.

Daily Coping 22 Jun 2021

By

I started to add a daily coping tip to the SQLServerCentral newsletter and to...

Why are my permissions missing?

By

You’d be amazed (or maybe you wouldn’t) how often I hear this: “I used...

Read the latest Blogs

Forums

Finding the Group

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Finding the Group

How to create SQL script to backup transaction log with append

By itmasterw 60042

Hi,   I am trying to write a backup script, in a way that...

SLEEP_BPOOL_STEAL wait type

By cphite

Does anyone know what the wait type SLEEP_BPOOL_STEAL means?  I cannot find any documentation...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers