首頁 > 資料庫 > mysql教程 > SQL 2000 Determine primary key from system table列出所有Prim

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

WBOY
發布: 2016-06-07 17:54:34
原創
1012 人瀏覽過

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可能不适用

相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板