Skip to content

SQL Server 维护计划

维护计划在数据库起到非常重要作用,每天做数据库备份、每周做索引重组、可能你可以想到更多的事,以下是我某项目中遇到问题的一些总结:

1、索引问题

“无法重新组织表 “表名” 的索引 “NC_index” (分区 1),因为已禁用页级锁定。”,其实只要启用有错误索引的“在访问索引时使用页锁”就可以解决问题。

2、执行T-SQL语句

当你执行某段T-SQL时你会发现他怎么老是找不到某个表或者其他等等错误,而当SQL代理执行时实际上默认是在master表,所以最好在T-SQL加上USE。

3、长T-SQL语句

把他当成一个存储过程不就行拉。哈哈~~~~~

相关日志

Categories: 技术.

Tags:

Comment Feed

No Responses (yet)



Some HTML is OK

or, reply to this post via trackback.

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word