select b.name as table_name,a.name as column_name,t.name
type_name
,a.max_length
,a.precision,a.scale,isnull(c.value,N‘‘) as memo
from sys.columns a
join sys.tables b on a.object_id=b.object_id and b.type=N‘U‘
join
sys.types t on a.system_type_id=t.system_type_id
left join
sys.extended_properties c on b.object_id=c.major_id and
a.column_id=c.minor_id
order by 1
结果----------
table_name column_name
type_name max_length
precision scale
memo
ActiveUser yunying_id
nvarchar 40 0
0
ActiveUser
yunying_id sysname 40
0 0
ActiveUser
game_id int 4
10 0
ActiveUser
roleid int 4
10 0
ActiveUser
grade int 4
10 0
ActiveUser
Active_time datetime 8
23 3
ActiveUser
dept int 4
10 0
ActiveUser
sid int 4
10 0
ActiveUser
rechage_yuanbao int 4
10 0
ActiveUser
consume_yuanbao_num int 4
10 0
ActiveUser
overplus_yuanbao_num int 4
10 0
ActiveUser
use_horse_model_id int 4
10 0
ActiveUser
hushenfu_grade int 4
10 0
ActiveUser
anqi_grade int 4
10 0
ActiveUser
lianti_grade int 4
10 0
ActiveUser
character_channel int 4
10 0
BASEUSER
yunying_id nvarchar 40
0 0
BASEUSER
yunying_id sysname 40
0 0
BASEUSER
game_id int 4
10 0
BASEUSER
create_date datetime 8
23 3
BASEUSER
dept int 4
10 0
BASEUSER
sid int 4
10 0
BASEUSER
recharge_yuanbao int 4
10 0
BASEUSER
Recharge_yuanbao_month int
4 10 0
BASEUSER login_times
int 4 10
0
BASEUSER
overplus_yuanbao_num int 4
10 0
dzl
id bigint 8
19 0
dzl
name varchar 8
0 0 节能abc