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

推荐订阅源

Google DeepMind News
Google DeepMind News
Stack Overflow Blog
Stack Overflow Blog
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
T
The Blog of Author Tim Ferriss
博客园 - 叶小钗
N
Netflix TechBlog - Medium
腾讯CDC
C
Check Point Blog
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
S
SegmentFault 最新的问题
F
Fortinet All Blogs
美团技术团队
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
F
Full Disclosure
Recorded Future
Recorded Future
D
DataBreaches.Net
博客园 - 【当耐特】
Martin Fowler
Martin Fowler
J
Java Code Geeks
I
InfoQ
Y
Y Combinator Blog
A
About on SuperTechFans
AI
AI
爱范儿
爱范儿
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Forbes - Security
Forbes - Security
W
WeLiveSecurity
M
MIT News - Artificial intelligence
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
Schneier on Security
Schneier on Security
The GitHub Blog
The GitHub Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
Latest news
Latest news
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Docker
Recent Commits to openclaw:main
Recent Commits to openclaw:main
量子位
V2EX - 技术
V2EX - 技术
Project Zero
Project Zero

博客园 - toon的泥瓦匠

在oj中Python的循环输入问题解决 LeetCode 2. Add Two Numbers swift LeetCode 01 Two Sum swift Protocol in Objective-C 阿里云Center OS 6.2 Nginx 配置 SSL/TLS HTTPS配置 阿里云Centos 6.3 64位 安全加固版 升级 Php 中的 Curl 7.19 到 7.35 iOS APNS配置(转) GCD dispath_async dispath_sync 各种混合使用测试情况 Mac OS X Redmine Backlogs安装日志 设计模式建议学习顺序 调试iOS 已经发布代码 Crash 文件分析出出错对应代码 iOS RSA公钥加密数据 服务端接受PHP私钥解密 反过服务端公钥加密数据 iOS端私钥解密数据 xcode调试找出错误行 iOS 日期格式串 setDateFormat 显示格式代码 iOS5 UI 设计新手段 Storyboard UIEdgeInsets Non-SQL 完成公司核名 sqlserver 2005 full-text 的创建和使用 - toon的泥瓦匠
varchar(max) text sqlserver 2005 数据库的正则替换
toon的泥瓦匠 · 2009-02-23 · via 博客园 - toon的泥瓦匠

对varchat(max)或者 text字段进行操作,估计很多人会遇到8K字符的限制。

网上流传的最多的是用存储过程 把字符取成小段小段的做。很麻烦。

今采用 SQL Server 2005 SQLCLR搞定。

步骤如下:

1.首先安装sqlserver2005和visual studio 2005。启用sqlserver2005的clr ,应先在sqlsever的查询分析器按实际情况执行下边的语句已配置 CLR支持 

exec sp_configure 'clr enabled'--查看状态
exec sp_configure 'clr enabled',1--1,启用clr\0,禁用clr
reconfigure with override--按提示(配置选项 'clr enabled' 已从 0 更改为 1。请运行 RECONFIGURE 语句进行安装。)运行此句

2.第一步,打vs新建项目类型-数据库-SQL Server项目。
(这部分可以参考
http://www.chenjiliang.com/Article/View.aspx?ArticleID=2413 SQLCLR(一)入门)

代码如下:

Code

//注意 12行 加入这行可以突破 T-SQL 8000字符的限制。

3.可以在sqlsever的查询分析器测试

select dbo.GLRegexReplace('abc','abc','def')

4.发布 用VS2005直接运行就可以了。如果需要发布到其他的电脑

参考

http://nayyeri.net/blog/create-assembly-issue-with-visual-studio-sql-server-database-projects/