Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Find name of Default Constraint?
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
00478230
Message ID:
00478238
Vues:
24
>Hi All,
>
>Is there a way to find out the name of the Default Constraint that is created when you use the DEFAULT Clause of the CREATE TABLE statement?
>
>I haven't been able to find them in the INFORMATION_SCHEMA views. Currently, I ALTER the column and then cut and paste the name. I'd like to automate this in a stored procedure.


Ok. To find the DEFAULT Constraint on mc_mdsvc.svc_ln I can do this:
SELECT O.Name 
	FROM sysobjects O, syscolumns C
	WHERE O.Parent_Obj = OBJECT_ID('mc_mdsvc') 
	AND C.Id = OBJECT_ID('mc_mdsvc') 
	AND O.Id = C.Cdefault
	AND C.Name = 'svc_ln'
However, I've been told not to query the system tables directly. Is there an acceptable way to do this?
TIA,
Bill Armbrecht
VFP MCP
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform