当前位置: 当前位置:首页 >数据库 >SQL Server批量修改字段的数据类型的代码实例 正文

SQL Server批量修改字段的数据类型的代码实例

2025-11-04 13:43:45 来源:多维IT资讯作者:IT科技类资讯 点击:605次
SQL Server批量修改字段的数据类型的代码实例
复制create procedure p_set    as    declare tb cursor for    SELECT sql=alter table [+d.name    +] alter column [+a.name+]     +b.name+(8,量修类型例3)    FROM syscolumns a left join systypes b on a.xtype=b.xusertype    inner join sysobjects d on a.id=d.id and d.xtype=U and d.name<>dtproperties    where    b.name in(decimal)    order by d.name,a.name    declare @sql varchar(1000)    open tb    fetch next from tb into @sql    while @@fetch_status = 0 begin    print @sql   exec(@SQL)   fetch next from tb into @sql    end    close tb    deallocate tb    go  1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.
作者:IT科技类资讯
------分隔线----------------------------
头条新闻
图片新闻
新闻排行榜