Home > Database > Mysql Tutorial > SQL 2000 Determine primary key from system table列出所有Prim

SQL 2000 Determine primary key from system table列出所有Prim

WBOY
Release: 2016-06-07 17:54:34
Original
1001 people have browsed it

SQL 2000 Determine primary key from system table列出所有Primary Key SELECT object_name(a.[id]) as [TableName] ,object_name(a.constid) as [PK_name] ,b.[name] as [PK_Column] FROM sysconstraints a inner join syscolumns b on a.[colid]+1 = b.[c

SQL 2000 Determine primary key from system table列出所有Primary Key

 SELECT object_name(a.[id]) as [TableName]
,object_name(a.constid) as [PK_name]
,b.[name] as [PK_Column]
FROM sysconstraints a inner join syscolumns b
on a.[colid]+1 = b.[colid] and a.[id] = b.[id]
WHERE a.status = 2593

PS. Status=2593还未找到确认的文件说明,另外覆合Key可能不适用

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template