新聞中心
這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
教您如何獲取SQL字段默認(rèn)值
在sql server 中,如何獲取SQL字段默認(rèn)值呢?下面就為您介紹實(shí)現(xiàn)該功能的方法,如果您遇到過(guò)類似的問(wèn)題,不妨一看,希望對(duì)您有所幫助。

sql server 中獲取SQL字段默認(rèn)值 ,獲取所有的默認(rèn)值列表:
- select
- object_name(c.id) as 表名
- ,c.name as 字段名
- ,t.name as 數(shù)據(jù)類型
- ,c.prec as 長(zhǎng)度
- ,p.value as 字段說(shuō)明
- ,m.text as 默認(rèn)值
- from syscolumns c
- inner join
- systypes t
- on c.xusertype=t.xusertype
- left join
- sysproperties p
- on c.id=p.id and c.colid = p.smallid
- left join
- syscomments m
- on c.cdefault=m.id
研究了很久 終于搞定了
獲取單個(gè)SQL字段默認(rèn)值列表
- select
- object_name(c.id) as 表名
- ,c.name as 字段名
- ,t.name as 數(shù)據(jù)類型
- ,c.prec as 長(zhǎng)度
- ,p.value as 字段說(shuō)明
- ,m.text as 默認(rèn)值
- from syscolumns c
- inner join
- systypes t
- on c.xusertype=t.xusertype
- left join
- sysproperties p
- on c.id=p.id and c.colid = p.smallid
- left join
- syscomments m
- on c.cdefault=m.id
- where objectproperty(c.id,'IsUserTable')=1
- and object_name(c.id) = 'T_good' and c.name = 'ishot'
【編輯推薦】
SQL修改字段默認(rèn)值
同一列SQL字符串相加的方法
教您如何修改sql server時(shí)間
SQL Server時(shí)間算法大全
SQL Server SA權(quán)限小技巧
本文標(biāo)題:教您如何獲取SQL字段默認(rèn)值
網(wǎng)站地址:http://m.fisionsoft.com.cn/article/dhposcj.html


咨詢
建站咨詢
