Hi all,
How can get the primary key string from the given table name? i know
it should from system tables of "sysobjects, syscolumns, and
sysconstraints", but when i execute the statement like that:
select a.name from syscolumns a,sysobjects b,sysconstraints c
where a.id = b.id and b.name ='Agreement' and a.id = c.id and a.colid
= c.colid and c.status = 1
i can't get the primary key out, what the trick here? bye the sql help
file,
'status' in sysconstraints table:
1 = PRIMARY KEY constraint.
2 = UNIQUE KEY constraint.
what is exact value refers to PRIMARY KEY constraint?
thanks,
Robert