代码改变世界

随笔分类 -  SQL

option(recompile)

2015-07-03 14:19 by Purplez, 931 阅读, 收藏,
摘要: option(recompile) 阅读全文

Transaction Save Point (SET XACT_ABORT { ON | OFF })

2015-05-07 16:00 by Purplez, 391 阅读, 收藏,
摘要: ref:http://blog.csdn.net/wym3587/article/details/6940630ref:http://www.cnblogs.com/jiajiayuan/archive/2011/07/13/2105398.html当 SET XACT_ABORT 为 OFF 时,... 阅读全文

with CTE AS

2015-05-06 14:37 by Purplez, 132 阅读, 收藏,
摘要: CTE/表变量/Temphttp://www.cnblogs.com/ziyeyimeng/articles/2366855.html 阅读全文

Cursor use

2015-04-21 18:57 by Purplez, 181 阅读, 收藏,
摘要: Ref:http://www.cnblogs.com/Gavinzhao/archive/2010/07/14/1777644.htmldeclare @Id varchar(100),@name varchar(10)declare ccursor cursor for select MAXID,... 阅读全文

sp_executesql

2015-04-08 11:42 by Purplez, 135 阅读, 收藏,
摘要: execute相信大家都用的用熟了,简写为exec,除了用来执行存储过程,一般都用来执行动态Sqlsp_executesql,sql2005中引入的新的系统存储过程,也是用来处理动态sql的, 如:exec sp_executesql @sql, N'@count int out,@id varch... 阅读全文