上一页 1 ··· 48 49 50 51 52 53 54 55 56 ··· 66 下一页

2014年10月26日

SQL Server 的三种用户自定义函数

摘要: create function fun_A() #标题函数、create function fun_name() returns output_type as begin return value end;returns intasbegin return 1;endgocreate functi... 阅读全文

posted @ 2014-10-26 20:27 蒋乐兴的技术随笔 阅读(495) 评论(0) 推荐(0) 编辑

SQL Server 全文索引

摘要: create table Document(ID int not null,Name nvarchar(255) not null,Body nvarchar(max) not null);gocreate unique index uq_ix_for_Document --#这里一定要加一个not... 阅读全文

posted @ 2014-10-26 19:51 蒋乐兴的技术随笔 阅读(251) 评论(0) 推荐(0) 编辑

2014年10月25日

SQL Server 表压缩

摘要: 表压缩有三个选项 1、page 2、row 3、none-----------------------------------------------------------------------------------------------------------------------... 阅读全文

posted @ 2014-10-25 19:53 蒋乐兴的技术随笔 阅读(795) 评论(0) 推荐(0) 编辑

SQL Server 一些重要视图4

摘要: sys.master_files 为每一个数据库的每一个文件返回行。 阅读全文

posted @ 2014-10-25 16:01 蒋乐兴的技术随笔 阅读(171) 评论(0) 推荐(0) 编辑

SQL Server 排序规则

摘要: 1、 查看排序规则 select serverproperty('collation');2、 指定列的排序规则 alter table T2 add Y nvarchar(32) collate Chinese_PRC_CI_AS; go ----------------------... 阅读全文

posted @ 2014-10-25 14:23 蒋乐兴的技术随笔 阅读(587) 评论(0) 推荐(0) 编辑

SQL Server 一些重要视图3

摘要: 1、 sys.dm_tran_locks; 为每一把锁返回一行、request_session_id 可以与sys.dm_tran_session_transactions \sys.dm_exec_connections相关联。 request_status 查看锁的分配情况2、 sys.... 阅读全文

posted @ 2014-10-25 09:58 蒋乐兴的技术随笔 阅读(181) 评论(0) 推荐(0) 编辑

SQL Server 一些重要视图2

摘要: 1、 sys.dm_tran_session_transactions 为每一个没有关闭的事务返回一行。session_id 可以与sys.dm_exec_connections.session_id 关联。2、 sys.dm_exec_connections 为每一个连接返回一行。most... 阅读全文

posted @ 2014-10-25 09:14 蒋乐兴的技术随笔 阅读(200) 评论(0) 推荐(0) 编辑

SQL Server save transaction

摘要: 准备: create table Nums(X int); 目的:只向表中插入一行。----------------------------------------------------------------------------------------------------------... 阅读全文

posted @ 2014-10-25 08:48 蒋乐兴的技术随笔 阅读(1785) 评论(0) 推荐(0) 编辑

SQL Server 输出受影响的行

摘要: 前期准备: create table Nums(X int); create table T(X int); go 目的:把对表Nums的insert | delete | update 反映到T表中。---------------------------------------------... 阅读全文

posted @ 2014-10-25 08:02 蒋乐兴的技术随笔 阅读(605) 评论(0) 推荐(0) 编辑

2014年10月24日

SQL Server Primary key 、clustered index 、 unique

摘要: primary key: 1、主键不可以有空值。 2、不可以有重复行。unique : 1、可以有空行。 2、不可以有重复行。clustered index: 1、可以有重复行。 2、可以有空行。 3、如果指定的列不unique 它会再加一个标志列以使索引变得唯一。 阅读全文

posted @ 2014-10-24 20:25 蒋乐兴的技术随笔 阅读(760) 评论(0) 推荐(0) 编辑

上一页 1 ··· 48 49 50 51 52 53 54 55 56 ··· 66 下一页

导航