Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Constraint Generator

By mkg_1232000,

This script can be used for generating the sql script for the constraints available on a particular table. There is a provision to generate script if the specified field(s) are part of the constraint.
While specifing the field name , delimit them with ';'.

Usage is ;
Use pubs
-- for generating the script for the table
exec Pre_Porting @objname = 'titleauthor',
                 @ScriptAction = 'ADD',
                 @FieldList = 'IGNORE'
-- for generating the script for the table, filter is job_id
exec Pre_Porting @objname = 'employee',
                 @ScriptAction = 'ADD',
                 @FieldList = 'job_id;'






Total article views: 140 | Views in the last 30 days: 1
 
Related Articles
FORUM

Generate Insert script

Generate Insert script

FORUM

Generate Script File Name

Generate Script File Name

SCRIPT

Generated script to update statistics

Generated script to update statistics

FORUM

Generate scripts for all databases

Generate scripts for all databases

ARTICLE

A Standard Database Security Script Generator

A script generator for standard security compliance.

 
Contribute