重庆分公司,新征程启航
为企业提供网站建设、域名注册、服务器等服务
SqlServer英文单词全字匹配
为普兰等地区用户提供了全套网页设计制作服务,及普兰网站建设行业解决方案。主营业务为成都网站建设、网站设计、普兰网站设计,以传统方式定制建设网站,并提供域名空间备案等一条龙服务,秉承以专业、用心的态度为用户提供真诚的服务。我们深信只要达到每一位用户的要求,就会得到认可,从而选择与我们长期合作。这样,我们也可以走得更远!
环境:Vs2013+Sql
Server2012
问题:现在数据库记录如下:
Sentence列保存的是英文的句子,我现在想找出所有包含“I”(单词)的句子,如果我用
Sentence
like
'%I',作为条件的话,那么像上图选中的那条有个单词“it“(不区分大小写的情况下),它也会被Select出来,而我只想找出含有“I”这个单词的句子的记录。
解决:SqlServer提供了模式匹配,类似于正则,详细内容查阅相关文档。
我先写了一个这样的条件:
Sentence
like
'%[^a-zA-Z]I[^a-zA-Z]%'
发现上图里的第一条,也就是“I
would...",“I”开头的单词没有被Select出来,也就是说,这个条件所匹配的是前面要一个非字母的符号(没有字符是不可以的),那么同样道理,最后面也需要一个非字母的符号(没有字符也是不可以的),所以可改成:
Sentence
like
'%[^a-zA-Z]I[^a-zA-Z]%'
or
Sentence
like
'I[^a-zA-Z]%'
or
Sentence
like
'%[^a-zA-Z]I'
不过感觉这样比较麻烦,如果把Sentence前后各加一个非字母的数字,像原本“I
would
like
I",把它变成“
I
would
like
I
"(前后各加一个空格),这样就能匹配最开始写的那个条件了:
'
'+Sentence+'
'
like
'%[^a-zA-Z]I[^a-zA-Z]%'
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
一、SQL Server关系数据库简介
1、SQL Server是由Microsoft开发和推广的关系数据库系统(DBMS),它最初是由Microsoft、Sybase和Ashton-Tate三家公司共同开发的,并于1988年推出了第一个OS/2版本。
2、关系数据库(RDBMS)管理系统功能:
》维护数据库数据之间的关系;
》保证数据存储的正确性;
》当出现系统故障的时候,将所有数据恢复到能够保证一致行的某种状态
3、RDBMS:SQL Server,Oracle,DB/2,Sybase,Informix
4、Non-RDBMS(File-based):Foxpro,Access
二、SQL Server 2000的版本
1、SQL Server 2000常见版本有:
》企业版(Enterprise Edition)
支持所有SQL Server 2000的功能。该版本多用于大中型产品数据库服务器,并且可以支持大型网站,企业OLTP(联机事务处理)和大型数据仓库系统OLAP(联机分析处理)所要求的性能。
》标准版(Standard Edition)
实用范围是小型的工作组或部门。它支持大多数的SQL Server2000功能。但是,不具有支持大型数据库,数据仓库和网站的功能。而且,不支持所有的关系数据库引擎的功能。
》个人版(Personal Edition)
主要适用于移动用户,因为他们经常从网络上断开,而运行的应用程序却仍然需要SQL Server 2000的支持。除了事务处理复制功能以外,能够支持所有SQL Server 2000标准版支持的特性。
》开发者版(Developer Edition)
适用于应用程序开发的版本,支持除图形化语言设置以外的SQL Server2000的所有其它功能。该版本主要适用于程序员在开发应用程序时,将SQL Server 2000作为其数据存储区。虽然开发版的功能齐备,但是只被授权为一个开发和测试系统,而不是一个产品服务器。
1.1 SQL Server特点
》与因特网的集成:
SQL Server 2000的数据库引擎全面支持XML(Extensive Markup Language,扩展标记语言),能使用户很容易地将数据库中的数据发布到Web页面上。
》可伸缩性与可用性:
可跨越从运行Windows 95/98的膝上型电脑到运行Windows 2000的大型多处理器等多种平台使用。另外,对联合服务器,索引视图等的支持,使得SQL Server 2000企业版可以升级到最大Web站点所需的性能级别。
》企业级数据库功能:
SQL Server 2000分布式查询可以引用来自不同数据库的数据,而且这些对于用户来说是完全透明的;分布式数据库将保证任何分布式数据更新时的完整性;复制可以使我们能够维护多个数据复本,这些用户能够自主地进行工作,然后再将所做的修改合并到发布数据库;SQL Server 2000关系数据库引擎能够充分保护数据完整性,还可以将管理并发修改数据库开销到最小。
》易于安装,部署和使用:
SQL Server 2000由一系列的管理和开发工具组成,这些工具使得在多个站点上进行SQL Server的安装,部署,管理和使用变得更加容易。开发人员可以更加快速地交付SQL Server应用程序,而且只需要进行最少的安装和管理就可以实现这些应用程序。
》数据仓库:
数据仓库是SQL Server 2000中包含的用于分析取和分析汇总数据以进行联机分析处理的工具。这个功能只在Oracle和其他更昂贵的DBMS中才有。
1.1.1 SQL Server 2000新特性
全面扩展了SQL Server 7.0的性能,可靠性和易用性。增加了一系列的功能,具体如下:
》在关系数据库方面的增强
》图形管理增强
》增强的联合数据库服务器
1.2 SQL Server 2000工具和实用程序
1、企业管理器 2、服务管理器 3、查询分析器 4、事件探查器
5、导入和导出数据 6、服务器网络使用工具 7、客户端网络使用工具 8、联机帮助文档
1.2.1 企业管理器
企业管理器是基于一种新的被称为微软管理控制台(Microsoft Management Console)的公共服务器管理环境,它是SQL Server 2000中最重要的一个管理工具。
企业管理器不仅能够配置系统环境和管理SQL Server,而且由于它能够以层叠列表的形式来显示所有的SQL Server对象,因而所有SQL Server对象的建立与管理都可以通过它来完成。
用企业管理可以完成的操作
》管理SQL Server服务器;建立与管理数据库;建立与管理表、视图、存储过程、触发程序、角色、规则、默认值等数据库对象,以及用户定义的数据类型;备份数据库和事务日志、
恢复数据库;复制数据库;设置任务调度;设置警报;提供跨服务器的拖放控制操作;管理用户账户;建立Transact-SQL命令语句以及管理和控制SQL Mail。
》在企业管理器中包含两个窗口,左侧的窗口是以“树状目录”显示的活动窗口,右侧是显示内容的窗口。
》单击左侧窗口中的加号,可以展开各个项目包含的子项目。
》通过选中的某个项目的节点,可以在右侧的窗口中看到该项目包含的内容。
1.2.2服务管理器(Service Manager)
1、SQL Server服务管理器是在服务器端实际工作时最有用的实用程序,服务管理器用来启动、暂停、继续和停止数据库服务器的实时服务,其提供的服务类型包括:SQL Server、SQL Server代理、Microsoft搜索和分布式事务协调器等。
A relational database, SQL Server
1, by Microsoft SQL Server is the development and popularization of relational database system (DBMS), which was originally by Microsoft, and Ashton Sybase Tate - three companies and joint development, launched in 1988, the first OS / 2 version.
2 and relational database management system (RDBMS) function:
"Maintaining the relationship between database data,
"Ensure the correctness of the data storage,
"When a system fault, all data recovery to ensure consistent done some condition
3, RDBMS: SQL Server, Oracle, DB / 2, Sybase Informix,
4 and amplified RDBMS (File - based) : Foxpro, Access
Second, SQL Server 2000 version
1 and SQL Server 2000 common version:
"Enterprise Edition (Enterprise Edition),
Support all SQL Server 2000 function. This version for large and medium-sized products, and can support the database server, large web companies OLTP (online transaction processing) and large data warehouse system (on-line analytical processing (OLAP) required performance.
"Standard version (Standard Edition),
A small range of practical working or departments. It supports most SQL Server2000 function. But, do not have support large database, data warehouse and the functionality of the site. And don't support all the relations of the database engine.
"Personal Edition (Personal Edition),
Mainly used in mobile users, because they often disconnected, and from the network of applications running still need SQL Server 2000 support. Besides the transaction copy, able to support all functions of SQL Server 2000 standard version of the support.
"Edition) Developer Edition (Developer
Suitable application development version, support except graphical Server2000 SQL language setting beyond all the other functions. This version is mainly used in the programmer development application, will SQL Server 2000 as data storage area. Although development version of the function, but only authorized for a development and testing system, not a product server.
1.1 SQL Server features
With the integration of the Internet:
SQL Server 2000 database engine comprehensive support XML Language, creating take (extensible Markup Language), that the user can easily be database data released to the Web page.
"Scalability and usability:
Can span from running Windows 95, 98 / the laptop to run Windows 2000 large-scale multiple processors etc. Various platforms. In addition, to jointly Server, etc, the support index view that SQL Server 2000 enterprise edition can upgrade to the largest Web site desired performance level.
"Enterprise databases functions:
SQL Server 2000 distributed query can quote from different database data, and these are completely transparent to users, Distributed database will ensure that any distributed data update integrity, Copy can enable us to maintain multiple data available, the user can work independently, and then will be done by modified merged into the database, SQL Server 2000 relational database engine can fully protect data integrity, still can be modified database management concurrent cost to a minimum.
"Easy to install, deployment and use:
SQL Server 2000 by a series of management and development tools, these tools at multiple sites on SQL Server installation, deploy, manage and use more easily. Developers can more quickly deliver SQL Server applications and requires only the least installation and management can achieve these applications.
"Data warehouse:
The data warehouse is SQL Server 2000 contains for analysis and summary data analysis on on-line analytical processing tools. This function only in Oracle and other more expensive DBMS.
1.1.1 SQL Server 2000 new features
Fully expanded the SQL Server 7.0 performance, reliability and usability. Increases the range of functions, specific as follows:
In the aspect of relational database
"Graphics management enhancement
The combination of enhanced database server
1.2 SQL Server 2000 tools, and utilities
1, enterprise management, service management 3, 4, event detection query parsers
5 and 6, the input and output data network, server client to use tools, tools Internet use online documentation
1.2.1 enterprise management
Enterprise Management is based on a new called Microsoft Management Console (r) of public Management Microsoft Server Management environment, it is the SQL Server 2000 in one of the most important Management tools.
Enterprise management can not only configuration system environment and management, but also because it SQL Server can cascade form to list all the SQL Server object, so all the SQL Server object of establishment and management can be accomplished by it.
In enterprise management can finish operation
"Management SQL Server Server. Establish and manage database, Establish and manage, view, storage process, triggering role, rules, procedures, by default, such as user defined object database of data types, Backup database and transaction log,
Restore database, Copy database, Set task scheduling, Set alarm, Provide cross-server drag-and-drop controls operating, Manage the user accounts, Establish Transact - SQL commands and the management and control of the SQL statement E-mail.
"In the enterprise management in the window contains two on" the window "directory tree right is the active window, showing the contents of the window.
"The window, click on various projects can deploy plus committeeapos contains.
"Through a project of the selected node in the window, can see on this project contains the content.
1.2.2 Service Manager (up) Service
1 and SQL Server service manager is in practical work when the Server is most practical program, service management is to start, stop, and continue to suspend the real-time database Server service, the service provided types include: SQL Server, SQL Server proxy, Microsoft search and distributed coordination, etc.
给分的啊 累死了!!
SQL Server 的读法
SQL 是缩写, 直接读字母 S-Q-L
server 的读音音标是:
英 [ˈsɜ:və(r)] 美 [ˈsɜ:rvə(r)]
SQL是英文Structured Query Language的缩写,意思为结构化查询语言。我们大多读他的缩写就是sql。直接读SQL(瑟我)