SQL SERVER 经验、资料收录
基本操作:
事务:
SET XACT_ABORT各种用法及显示结果
例子:
--遇到错误,立即停止
SET XACT_ABORT on
Commit Tran
--只提交正确的操作,回滚错误行
SET XACT_ABORT OFF
Commit Tran
锁:
SQL2005中的事务与锁定系列 (http://blog.csdn.net/happyflystone/category/348844.aspx)
优化:
http://www.cnblogs.com/tomsun/archive/2005/12/14/296959.html
博客:
SQL如何查询当前周的第一天(周一),跟当前周的最后一天(周日)
AS "第一天(周一)",
CONVERT(VARCHAR(10), GETDATE() + ( 8-DATEPART(weekday, GETDATE()) ), 120)
AS "最后一天(周日)"
用SQL2008的MERGE语句同步表
http://blog.csdn.net/guguda2008/archive/2010/10/26/5967336.aspx
SQL Server范例开发大全
http://xidong.net/File001/File_76856.html
数据库备份
每日差异
BACKUP DATABASE Decision TO DISK=N'E:\Decision\SQLBackUp\Decision_Diff.bak' WITH DIFFERENTIAL, NOFORMAT, NOINIT, NAME = N'Decision-差异数据库备份', SKIP, NOREWIND, NOUNLOAD, STATS = 10
每周整体
BACKUP DATABASE Decision TO DISK=N'E:\Decision\SQLBackUp\Decision.bak' WITH FORMAT, COMPRESSION