日期:2014-05-18 浏览次数:20480 次
select @sql=isnull(@sql,'') +' alter table '+c.name +' alter column '+a.name +' varchar(50);' from sys.columns a join sys.types b on a.system_type_id=b.system_type_id join sys.objects c on a.object_id=c.object_id where b.name='bit' and c.type='U' exec (@sql)
------解决方案--------------------
declare @sql varchar(8000) select @sql=isnull(@sql,'') +' alter table '+c.name +' alter column '+a.name +' varchar(50);' from sys.columns a join sys.types b on a.system_type_id=b.system_type_id join sys.objects c on a.object_id=c.object_id where b.name='int' and c.type='U' exec (@sql)