1 Select Sysobjects.Name As Tb_name, Syscolumns.Name As Col_name, Systypes.Name As Col_type, Syscolumns.Length As Col_len, Isnull(Sysproperties.Value,Syscolumns.Name) As Col_memo,
2 Case When Syscolumns.Name In
3 (Select 主键=A.Name
4 From Syscolumns A
5 Inner Join Sysobjects B On A.Id=B.Id And B.Xtype='U' And B.Name<>'Dtproperties'
6 Where Exists(Select 1 From Sysobjects Where Xtype='Pk' And Name In (
7 Select Name From Sysindexes Where Indid In(
8 Select Indid From Sysindexkeys Where Id = A.Id And Colid=A.Colid
9 )))
10 And B.Name=Sysobjects.Name
11 )
12 Then 1 Else 0 End As Is_key
13
14 From Sysobjects,Systypes,Syscolumns
15 Left Join Sysproperties On (Syscolumns.Id = Sysproperties.Id And
16 Syscolumns.Colid = Sysproperties.Smallid)
17
18 Where (Sysobjects.Xtype ='U' Or Sysobjects.Xtype ='V')
19 And Sysobjects.Id = Syscolumns.Id And Systypes.Xtype = Syscolumns.Xtype
20 And Systypes.Name <> 'Sysname' And Sysobjects.Name Like '%' Order By Sysobjects.Name, Syscolumns.Colid
结果如图:
- 查看更多软件信息>> SQL Server数据库压缩与日志清理工具 1.0.7.125
- 本软件在数据库类中排名第24位
- 用户评分:0 | 有 0 人点评
- 更新时间:2011年12月27日
- 开发商:未知
- 下载次数:49938次
- 应用平台:Win XP/Win2000/Win98/Win ME
- 软件分类:数据库类
- 论坛讨论:进入论坛