打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
查找sql表里含有某个字段的过程
declare @tablename varchar(50),@sql varchar(3000)
declare table1 cursor for 
select object_name(a.id)as tablename from syscolumns a,
sysobjects b,
systypes c
where a.id=b.id
and a.xtype=c.xtype
and b.xtype='u'
and c.name in('varchar','nvarchar','char','nchar','text','ntext')and object_name(a.id)<>'t'
and a.name='gsbh' order by object_name(a.id)
open table1
fetch next from table1 into @tablename
 while @@FETCH_STATUS = 0
  begin
    select @sql='update  '+@tablename+' set gsbh=''117'' where gsbh=''118'''
    exec(@sql)
    fetch next from table1 into @tablename
   end

close table1
deallocate table1





本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
如何为SQL Server表数据生成insert脚本
SQL批量删除用户表(先删除所有外键约束,再删除所有表)
在SQL Server中如何获取某用户对某个表中所有权限
数据操作技巧: 禁用约束和触发器
数据库质疑修复总结 For SQL Server 2000/2005/2008/2008R2 – 微软亚太区数据库技术支持组 官方博客
外国的注入技巧收集
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服