相思资源网 Design By www.200059.com
-->Title:Generating test data
-->Author:wufeng4552
-->Date :2009-09-25 09:56:07
if object_id('tb')is not null drop table tb
go
create table tb(ID int,name text)
insert tb select 1,'test'
go
--方法1
复制代码 代码如下:
select sql_variant_property(ID,'BaseType') from tb

--方法2
复制代码 代码如下:
select object_name(ID)表名,
c.name 字段名,
t.name 数据类型,
c.prec 长度
from syscolumns c
inner join systypes t
on c.xusertype=t.xusertype
where objectproperty(id,'IsUserTable')=1 and id=object_id('tb')
标签:
判断,字段类型

相思资源网 Design By www.200059.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
相思资源网 Design By www.200059.com

评论“SQL 判断字段类型语句”

暂无SQL 判断字段类型语句的评论...