>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