Scripts

Technical Article

SQL Server Current Activity SuperCheck

This gives a quick check of the current activity on a SQL Server. I developed this after getting continually frustrated with "Current Activity" in SQL/EM getting blocked by processes when I needed to see blocking issues on the server. It has been immensely valuable to me in quickly identifying production-stopping issues on the database. It […]

4.2 (5)

2001-08-13

4,853 reads

Technical Article

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,666 reads

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

2001-08-09

3,531 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)

2001-08-09

4,614 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)

2001-08-08

5,098 reads

Blogs

Creating a user for a STONITH resource in vSphere

By

I previously blogged about how to create a STONITH resource for a pacemaker cluster...

Default event_file path for Extended Events

By

Foreword Have you ever wondered where the .xel file is saved when you create a...

Query Store Hints in SQL Server 2022

By

Another neat little feature in SQL Server 2022 is Query Store Hints. This is...

Read the latest Blogs

Forums

Display Top N values of a table with calculation next to it

By Soof1234

Hi, In Power BI Report Builder I need to use SSRS code for my...

Package runs in Debug mode but fails otherwise

By Alexp012

Hi We have a SSIS package that uploads data to Blob storage. The package...

Can anyone suggest a plan with backup full and backup log without backup diff ?

By vpmaciel

I need only one backup full at mid night, and one backup log each...

Visit the forum

Ask SSC Logo Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers