Scripts

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,585 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,385 reads

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)

2001-08-08

2,973 reads

Blogs

Logging Messages with Raiserror – #SQLNewBlogger

By

Another post for me that is simple and hopefully serves as an example for...

Daily Coping 8 Mar 2021

By

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

Webinar – Building a Proper SQL Server Database Security Model

By

Tomorrow, March 9, 2020, at 3 PM EST, I will be giving a presentation...

Read the latest Blogs

Forums

SSRS report download fails

By Tomys

Hi. I am trying to download a report from SSRS 2019 in word format...

Many executionplans for one query, why?

By oRBIT

I've yet to find an answer for this. I've found a few queries that...

Index on View

By AMCiti

Dear Group: I was going to create an index on a view we have,...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers