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)

Alexander Chigrik

2001-08-09

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

Rahul Sharma

2001-08-08

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

Brian Knight

2001-08-08

2,896 reads

Blogs

Drop Database Objects Practically Risk-Free!

By administrator

FIRST OF A TWO PART SERIES Some months ago, a fellow DBA came to...

Lengthen a Primary Key–#SQLNewBlogger

By Steve Jones

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

Setup SQL Server Alert to get automatically notified of database blockings

By SQLPals

Suppose you want to or need to know anytime your SQL Server is experiencing...

Read the latest Blogs

Forums

Protecting Data Between Services

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Protecting Data Between Services

SQL browser and port number

By John Deupree

We have several new servers running SQL 2014.  Some servers are single instance servers...

ssms crashes when editing .sql script

By Samwell

I’ve recently been having an issue with ssms freezing and crashing while editing a...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers