select b.cdefault ,* from sysobjects a ,syscolumns b where a.id = b.id and a.name = 'exjob' and b.name = 'voided'
得到 0,
帮忙讲解下 syscolumns.cdefault
顺便讲下syscolumns这个表比较常用的一些字段 (别百度复制哦 亲)分少莫嫌
------解决方案--------------------
--create table exjob(id int,voideid int default 1)
go
select cdefault from syscolumns where name='voideid'
/*
cdefault
-----------
1234103437
(1 行受影响)
*/
go
select * from sysobjects where id=1234103437
/*
name id xtype uid info status base_schema_ver replinfo parent_obj crdate ftcatid schema_ver stats_schema_ver type userstat sysstat indexdel refdate version deltrig instrig updtrig seltrig category cache
-------------------------------------------------------- ----------- ----- ------ ------ ----------- --------------- ----------- ----------- ----------------------- ------- ----------- ---------------- ---- -------- ------- -------- ----------------------- ----------- ----------- ----------- ----------- ----------- ----------- ------
DF__exjob__voideid__498EEC8D 1234103437 D 1 0 0 0 0 1218103380 2013-01-02 15:30:13.467 0 0 0 D 0 6 0 2013-01-02 15:30:13.467 0 0 0 0 0 2048 0