Maintenance and Management

Script Generator for Triggers

  • Script

This Stored Procedure creates the script of all existing triggersOptionally it creates the script to drop the triggers too.Triggers may belong to different owners. This procedure takes care of it.In SQLServer Enterprise Manager there is a facility to generate scripts forTables, Views, Stored Procedures etc.But it won't generate script for triggers unless we include the […]

5 (6)

2002-03-27

2,512 reads

Detect the Amount of Wasted Data Space in a Table for 2000

  • Script

SP_WASTED_SPACE will run through each column in your database and print a report of all the character columns. It will then print a report with :* The maximum length that a column is storing* The average length of data stored in each column* The amount of wasted space in each column* Hints on how to […]

2002-03-14

1,104 reads

Display Rows/Space Used by all user tables

  • Script

This procedure will display the rows, reserved, data, index and unused space used in KB for all user tables in the database.  The idea is to call sp_spaceused repeatedly.  Limitation: certain versions of sp_spaceused will truncate the table name to 20 characters.Speed will depend on current activity level and locking in the database.  It will […]

2002-03-14

382 reads

Blogs

Azure Platform Series: How to setup Azure Cloud Shell

By

This blog post will be a series on the Azure Platform and some things...

Daily Coping 5 June 2020

By

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

Use Chocolatey to Install Multiple SQL Server 2019 Instances for Testing

By

I’m working on a project where it’s useful to automate environment setup and teardown...

Read the latest Blogs

Forums

Attach and Detach Method vs SQL Manage object method

By Nusc

Hi there, if you want to detach a database you would right click on...

How to generating Excel File with multi sheet by using SQL server 2012?

By ahmed_elbarbary.2010

I need to create stored procedure or query or any thing on SQL server...

performance tuning for a subquery

By rohitkocharda

Hey Guys I have a quick questions regarding a better way to write a...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers