SQL语句
文章平均质量分 77
cddchina
这个作者很懒,什么都没留下…
展开
-
SQL语句1——单表查询
create database aaadrop database aaa--结构drop--内容delete--列名 数据类型 [完整性约束]--1、列名,命名规则--2、数据类型:text char(8000) nchar varchar nvarcha int bigint smallint tinyint money float,numeri原创 2012-10-18 08:51:25 · 927 阅读 · 0 评论 -
SQL有自带的处理xml的方法
分享链接:sql处理xml原创 2015-09-01 17:34:10 · 453 阅读 · 0 评论 -
事务的编写
BEGIN TRY BEGIN TRANSACTION declare @iActionID int,@ErrorMessage varchar(MAX) update xxxxxxx IF @@TRANCOUNT > 0 COMMIT TRANSACTION ;原创 2015-02-10 16:14:02 · 510 阅读 · 0 评论 -
UDL使用
使用通用数据连接文件(*.UDL,以下简称文件)来创建ADO连接,可以和ODBC一样可视化地定义要连接的数据源,从而实现数据访问的透明性。 1.使用UDL文件来创建ADO连接 创建ADO的连接,首先要设置ADO连接对象的ConnectionString属性,该属性提供所要连接的数据库类型、数据所处服务器、要访问的数据库和数据库访问的安全认证信息。比较专业的方法是在Connectio转载 2014-12-30 10:51:59 · 1300 阅读 · 0 评论 -
SQL跨域连接数据库表
EXEC master.dbo.sp_addlinkedserver @server = N'RIS_T',@srvproduct='', @provider=N'SQLOLEDB', @datasrc=N'192.168.20.3' /* For security reasons the linked server remote logins password is cha原创 2015-01-19 15:53:39 · 1365 阅读 · 0 评论 -
SQL 的跨域连接数据表
1.开启Ad Hoc Distributed Queries组件,在sql查询编辑器中执行如下语句: exec sp_configure 'show advanced options',1reconfigureexec sp_configure 'Ad Hoc Distributed Queries',1reconfigure 2.关闭Ad Hoc Distr原创 2015-01-19 15:01:55 · 834 阅读 · 0 评论 -
MySql触发器
http://www.cnblogs.com/nicholas_f/archive/2009/09/22/1572050.html原创 2013-07-17 09:18:43 · 472 阅读 · 0 评论 -
Acess中GetRecordCount()返回-1问题
为了使用RecordCount属性,我们需要使用设置好游标(静态/客户):在m_pSet->Open()前加上:m_pSet->CursorType = adOpenStatic;m_pSet->CursorLocation = adUseClient;原创 2013-03-05 11:31:09 · 858 阅读 · 0 评论 -
SQL语句3——触发器
--触发器的建立和使用--创建触发器 并 起触发器名字stri_stucreate trigger stri_stu--on 加表名 对那个表添加触发器(如:on stu 对表stu创建触发器)--after 加(增删改 insert delete update )--as 是触发器要执行的操作--begin --declare 声明变量( 如:declare @t原创 2012-11-04 16:44:12 · 2707 阅读 · 0 评论 -
SQL语句4
use studentselect *from student--删除表drop table student--建表create table student(id int,age int,score int,addr nvarchar(20))--创建check约束ALTER table student add constraint aa che原创 2012-11-29 22:41:30 · 430 阅读 · 0 评论 -
SQL语句2——统计查询
select sdept,count(*) 总人数,avg(sage) 平均年龄from studentgroup by sdept--rule1:分组字段一般都会出现在select后 rule2:如果一个查询select后既有单个列, 又有统计列,那么该查询必须用到 分组,而且单个列即为分组字段 rule3:where是全表筛原创 2012-10-19 17:03:02 · 4332 阅读 · 0 评论 -
关于SQLSERVER中使用正则表达式的方式
关于SQLSERVER中使用正则表达式的方式1、在SQLSERVER中创建内置函数例如:-----------------------------------------------------------------------------------------------------CREATE FUNCTION dbo.RegExpTest ( @source原创 2016-03-07 17:31:59 · 11734 阅读 · 1 评论