惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
雷峰网
雷峰网
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Spread Privacy
Spread Privacy
H
Hacker News: Front Page
PCI Perspectives
PCI Perspectives
Webroot Blog
Webroot Blog
罗磊的独立博客
H
Heimdal Security Blog
TaoSecurity Blog
TaoSecurity Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
大猫的无限游戏
大猫的无限游戏
月光博客
月光博客
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Google Online Security Blog
Google Online Security Blog
Last Week in AI
Last Week in AI
美团技术团队
Help Net Security
Help Net Security
The Hacker News
The Hacker News
C
Cisco Blogs
T
The Blog of Author Tim Ferriss
J
Java Code Geeks
The Register - Security
The Register - Security
IT之家
IT之家
WordPress大学
WordPress大学
Jina AI
Jina AI
Recent Commits to openclaw:main
Recent Commits to openclaw:main
H
Help Net Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Threat Research - Cisco Blogs
P
Proofpoint News Feed
NISL@THU
NISL@THU
爱范儿
爱范儿
The GitHub Blog
The GitHub Blog
Scott Helme
Scott Helme
V
Vulnerabilities – Threatpost
B
Blog
T
Tenable Blog
博客园 - 三生石上(FineUI控件)
T
The Exploit Database - CXSecurity.com
S
Security Affairs
小众软件
小众软件
Hacker News: Ask HN
Hacker News: Ask HN
Security Latest
Security Latest
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
W
WeLiveSecurity
A
Arctic Wolf
L
LINUX DO - 热门话题
Google DeepMind News
Google DeepMind News
M
MIT News - Artificial intelligence

博客园 - 恋地高飞

超级弹窗代码(P2P,360都拦截不了 baset64加密解密代码 com/c.js木马攻击...(转) asp.net TextBox显示密码 - 恋地高飞 - 博客园 Ext.Window窗口下onclick="Button1_Click",不能提交的问题 IIS7 中使用 UrlRewritingNet(转) Reflector使用手记 学习SQL Server全文索引 (转 ) 查询同一表内多字段同时重复记录的SQL语句 asp.net中Excel导入(使用微软OLEDB驱动) asp.net获取URL和IP地址 警告: 程序集绑定日志记录被关闭。 Repeater1绑定数据,编辑数据的一些参考文章 asp.net下linkbutton的前后台使用方法 sqlserver 中判断是否数字,是否汉字的方法 301永久重定向asp.net实现方法 Net程序如何防止被注入 UrlRewritingNet 完美实现 ASP.NET 2.0 中的URL重写(映射) (转) FusionCharts一款flash统计控件,可以用于C#
sql批量修改表名(前缀)--亲测
恋地高飞 · 2012-01-08 · via 博客园 - 恋地高飞

exec   sp_msforeachtable    
@command1='
  declare   @o   sysname,@n   sysname    
  select   @o=''?''  
  ,@n=stuff(@o,1,charindex(''].[fg_'',@o)+6,''fgjzw_'')  
  ,@n=left(@n,len(@n)-1)  
  exec   sp_rename   @o,@n',  
  @whereand='   and   o.name   like   ''fg_%'''

declare @oldName varchar(30), @newName varchar(30)
declare cursor_taname CURSOR FOR SELECT name,name as newname FROM sysobjects where type='u'
OPEN cursor_taname FETCH NEXT FROM cursor_taname INTO @oldname,@newName WHILE @@FETCH_STATUS=0
BEGIN set @newName=Replace(@newName,'W_','M_') print(@oldname+', mailto:%20+@newName) EXEC sp_rename @oldname,@newName FETCH NEXT FROM cursor_taname INTO @oldname,@newName

END CLOSE cursor_taname DEALLOCATE cursor_taname

 declare @oldName varchar(30),
 @newName varchar(30)
declare cursor_taname   CURSOR   FOR  
SELECT name,upper(name) as newname FROM sysobjects where type='u'
OPEN   cursor_taname  
FETCH   NEXT   FROM   cursor_taname   INTO   @oldname,@newName
WHILE   @@FETCH_STATUS=0     
  BEGIN 
SET @newName=(replace(@oldname,'Ad','Fzw_Ad'))
 print(@oldname+',   '+@newName)
EXEC   sp_rename  @oldname,@newName
 FETCH   NEXT   FROM   cursor_taname   INTO   @oldname,@newName
  END     
CLOSE   cursor_taname  
DEALLOCATE   cursor_taname

警告: 更改对象名的任一部分都可能会破坏脚本和存储过程。

刷新数据库表名修改成功!