数据库的表信息
select [name] from sysobjects where xtype='U'and [name]<>'dtproperties' order by [name]
数据库表的列信息
sp_columns 'wxq_permissioninfo'
某列的说明字段的信息
select (select value from sys.extended_properties where name='MS_Description' and major_id=id and minor_id=colorder) from syscolumns where id=object_id('wxq_permissioninfo') and name='PositionId'
获取表的扩展属性
SELECT p.* FROM sys.tables AS tbl INNER JOIN sys.extended_properties AS p ON p.major_id=tbl.object_id AND p.minor_id=0 AND p.class=1 WHERE (tbl.name=N'表名' and SCHEMA_NAME(tbl.schema_id)=N'dbo') AND p.name='属性名'
获取某个表字段的扩展属性
SELECT *
FROM ::fn_listextendedproperty (NULL, 'user', 'dbo', 'table', '表名', 'column', default)
/*******************************数据库扩展属性*************************************/ /*******************************表的扩展属性(ListInfo清单表为例)*************************************/ |
varchar=string
varchar2=string
nvarchar=string
nvarchar2=string
char=string
nchar=string
text=string
longtext=string
ntext=string
string=string
date=DateTime
datetime=DateTime
smalldatetime=DateTime
smallint=int
single=Single
int=int
number=int
bigint=long
tinyint=int
float=decimal
numeric=decimal
decimal=decimal
money=decimal
smallmoney=decimal
real=decimal
bit=bool
binary=byte[]
varbinary=byte[]
image=byte[]
raw=byte[]
long=byte[]
long raw=byte[]
blob=byte[]
bfile=byte[]
uniqueidentifier=Guid
integer=int
double=Double
enum=Enum
timestamp=DateTime
variant=object