Hi Manish,
Witht eh limited information, we can guide you.
You can use sp_rename if you wan to do for a specific constraint. This is the syntax
sp_rename [ @objname = ] 'object_name' , [ @newname = ] 'new_name'
[ , [ @objtype = ] 'object_type' ]
'Object_type' is 'constraint'
I dont know what will be the new name, I assume that you want to follow some naming convention. Uou can get the list of constraints from sysobjects to get information over most of the constraints.
SELECT 'EXEC sp_Rename '''+name +''', '''+xtype+'_'+name +''', ''CONSTRAINT''' FROM sysobjects Where xtype in ('C', 'D', 'PK', 'UQ', 'FK')
Get he results and execute them :)
xtype in sysobjects will show the type of constraint.
C - Check Constraint
D - Default constraint
PK - Primary key
UQ - Unique key
FK - Foreign key
The difference between table constraints and column constraints are discussed mainly with Check constraints as there could be table level check constraints and column level check contraints.
PK , UQ and FK are table level constraints. Default is anyway for a column and is considered as column constraint
G.R.Preethiviraj Kulasingham MCITP: DBA
http://preethiviraj.blogspot.com/
Plan Your Work and Work Your Plan!