最新评论

共2页: 1 2 下一页 
to 1楼:有些时候是不用using的。
为什么不用using(Ping p = new Ping()){...}呢?
re: 春节广州西关行 Jay 2005-06-07 23:43  
治安是不太好啊,怕死別回來
re: 春节广州西关行 Jay 2005-06-07 23:42  
你什么时候回来广州?
re: 春节广州西关行 cheerly 2005-05-16 18:17  
顺着清音的叶子爬过来,专业的评语说不出来,但是给我的感觉是“看的好累!”
如何得到索引信息了?SQLServer的索引好像是存在垃圾索引数据的
re: 春节广州西关行 依栏望海集 2005-03-07 10:41  
To 清音: 相机的宽容度比人眼小很多,在室内很容易得到这种强对比的片子。
re: 春节广州西关行 清音 2005-03-07 10:22  
PS過?好黑
按经常编程的习惯,倒是用第一种方法。想不到还会出现这个问题。。
re: 读及其它 widerflowers 2005-01-07 10:54  
满眼扫去,能看懂的就是照片和这个了
给你弄的,满眼中国字我都茫然咯
re: 想起K.I.S.S. 小牛哥 2004-12-31 00:59  
KISS内容管理系统非常有名气,有空你研究研究
re: npgsql 0.7beta3 的一个Bug (submitted) 依栏望海集 2004-12-30 11:51  
已经从首页撤回。但我只是想推动一下这个数据库在中国的发展。
这样的文章不要发布到首页。
To cookieswolf :
用这么多函数是比较省事,但效率有点低。当然,一般得到信息都是在配置中用,效率可以忽略。
SELECT
(case when a.colorder=1 then d.name else '' end) N'表名',
a.colorder N'字段序号',
a.name N'字段名',
(case when COLUMNPROPERTY( a.id,a.name,'IsIdentity')=1 then '√'else '' end) N'标识',
(case when (SELECT count(*)
FROM sysobjects
WHERE (name in
(SELECT name
FROM sysindexes
WHERE (id = a.id) AND (indid in
(SELECT indid
FROM sysindexkeys
WHERE (id = a.id) AND (colid in
(SELECT colid
FROM syscolumns
WHERE (id = a.id) AND (name = a.name))))))) AND
(xtype = 'PK'))>0 then '√' else '' end) N'主键',
b.name N'类型',
a.length N'占用字节数',
COLUMNPROPERTY(a.id,a.name,'PRECISION') as N'长度',
isnull(COLUMNPROPERTY(a.id,a.name,'Scale'),0) as N'小数位数',
(case when a.isnullable=1 then '√'else '' end) N'允许空',
isnull(e.text,'') N'默认值',
isnull(g.[value],'') AS N'字段说明'
--into ##tx

FROM syscolumns a left join systypes b
on a.xtype=b.xusertype
inner join sysobjects d
on a.id=d.id and d.xtype='U' and d.name<>'dtproperties'
left join syscomments e
on a.cdefault=e.id
left join sysproperties g
on a.id=g.id AND a.colid = g.smallid
order by object_name(a.id),a.colorder
多谢progame, cookieswolf 和 春鱼 补充 Ms sql 的语句
其实不用那么麻烦!
select lower(a.name) as tablename,rtrim(b.name) as colname,case when h.id is not null then 'PK' else '' end as primarykey
,type_name(b.xusertype) + case when b.colstat & 1 = 1 then '[ID(' + convert(varchar,ident_seed(a.name)) + ',' + convert(varchar,ident_incr(a.name)) + ')]' else '' end as type
,b.length,case b.isnullable when 0 then 'N' else 'Y' end as [isnull],isnull(e.text,'') as [default],convert(varchar(30),isnull(c.value,rtrim(b.name))) as descript,'1'
from sysobjects a,syscolumns b
left outer join sysproperties c on b.id = c.id and b.colid = c.smallid
left outer join syscomments e on b.cdefault = e.id
left outer join (select g.id,g.colid from sysindexes f,sysindexkeys g where f.id = g.id and f.indid = g.indid and f.indid > 0 and f.indid < 255 and (f.status & 2048)<>0) h on b.id = h.id and b.colid = h.colid
where a.id = b.id and a.xtype='U' and a.id = object_id(a.name)
多谢progame 和 春鱼 补充
Ms SQL Server 的扩展属性(Extenable Properties) 是可以通过系统存储过程fn_listextendedproperty得到的。

扩展属性包括关于表、列、和其他系统对象的信息。例如对列的注释。

以下是列出关于表的列(字段)注释的简单实例:

CREATE table T1 (id int , name char (20))
EXEC sp_addextendedproperty 'caption', 'Employee ID', 'user', dbo, 'table', 'T1', 'column', id
EXEC sp_addextendedproperty 'caption', 'Employee Name', 'user', dbo, 'table', 'T1', 'column', name

SELECT *
FROM ::fn_listextendedproperty (NULL, 'user', 'dbo', 'table', 'T1', 'column', default)
re: 虫子加油!:P 依栏望海集 2004-12-24 13:27  
多谢!
共2页: 1 2 下一页