microsoft sql相当于mysql的REGEXP
发布时间:2020-12-14 04:27:30 所属栏目:Windows 来源:网络整理
导读:我正在尝试重建我在Microsoft sql中为 mysql创建的数据库查询.我在Microsoft sql中寻找一个术语,其行为类似于REGEXP 这是一个如何使用该术语的例子 select * from musicdetails WHERE artistname REGEXP '^".mysql_escape_string($_GET['search'])."$' 任何
我正在尝试重建我在Microsoft sql中为
mysql创建的数据库查询.我在Microsoft sql中寻找一个术语,其行为类似于REGEXP
这是一个如何使用该术语的例子 select * from musicdetails WHERE artistname REGEXP '^".mysql_escape_string($_GET['search'])."$' 任何帮助将非常感激 解决方法
在这里(编译为SQL CLR程序集):
using System.Collections; using System.Text.RegularExpressions; using Microsoft.SqlServer.Server; public partial class UserDefinedFunctions { [SqlFunction] public static bool RegexMatch(string expr,string regex) { return Regex.IsMatch(expr,regex); } [SqlFunction] public static string RegexReplace(string expr,string regex,string replace) { return Regex.Replace(expr,regex,replace); } [SqlFunction(FillRowMethodName="GetToken",TableDefinition="Value nvarchar(max)")] public static IEnumerable RegexSplit(string expr,string regex) { return Regex.Split(expr,regex); } public static void GetToken(object row,out string str) { str = (string) row; } } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- windows-7 – 为什么控制台输出这么慢?
- F12在Windows 7/8上的Delphi调试器中不起作用
- Windows Azure应用程序所需的实例数
- windows-server-2000 – 如何在Windows 2000服务器上生成Wi
- 在Windows 7上使用带有RSelenium的phantomjs
- active-directory – “匿名登录”vs“NTLM V1”禁用什么?
- remote-desktop – 为什么RDP不接受我存储的凭据,并让我每次
- Office 365 – 垃圾邮件过滤的“敏感词列表”中有什么?
- MPlayer音乐播放器项目讲解
- 如何使用Microsoft Visual C 2008编译PHP扩展?
推荐文章
站长推荐
- 相机 – Windows Phone 8镜头增强现实
- windows-phone-8 – 在调用MobileFirst适配器返回
- windows-xp – 物理到虚拟,无法重新激活窗口,因为
- 批处理文件 – Windows批处理将记录添加到主机文
- group-policy – 以编程方式或通过脚本“触摸”软
- Windows Server Backup 2012中“Hyper-V”与分区
- windows-8 – 评价应用程序时出错
- windows-server-2008 – Windows Server 2008 –
- .net – AssemblyInfo属性如何映射到Win32 VERSI
- 在Windows 7中,使用ActivePerl @ARGV为空
热点阅读