You are on page 1of 43

Best Practices Analyzer Tool for Microsoft SQL Server 2000 Rule Reference This document describes the

rules included in the Best Practices Analyzer !0!

Rule Categories
Backup and Recovery
"atabase Bac#u$s %ailed Bac#u$s Master and MS"B Bac#u$ &'(L') Lo* Bac#u$s Recovery Model +sa*e Reuse of Bac#u$ %ile

Configuration Options
Affinity Mas# Allo, +$dates -nabled %iber Mode Ma. Server Memory Priority Boost -nabled Recovery /nterval Set ,or#in* set size disabled

Database Design
Tables ,ithout Primary 0eys or +ni1ue 2onstraints +ser 'b3ect &amin*

Database Administration
Auto 2reation of Statistics "atabase 2om$atibility Level "atabase "is# S$ace "atabase %ile 2om$ression "atabase %ile Placement "atabase SQL '$tions /nde. %ra*mentation Lo* %ile )ro,th 4irtual Lo* %ile 2ount

Deprecation
2R-AT- "ATABAS- ,ith %'R L'A" "efaults and Rules "e$recated Builtin %unctions &on5Ansi 'uter 6oins S-T+S-R usa*e Strin* 7 -.$ression Aliasin* +se of s$(dbo$tion

Full-Text

"u$licate %ull5Te.t $redicates %ull5Te.t 2han*e Trac#in* -nabled %ull5Te.t Bac#*round Services '$timized %ull Te.t BL'B -.tension Ty$e %ull Te.t 2atalo* 2ount %ull Te.t 2atalo* Placement %ull Te.t Pro$erty Store Size MSSearch Service Account Timestam$ 2olumn for %ull5Te.t

eneral Administration
A4s and Severe -rrors -rror Lo* Size &+LL 88servername 9tem$db9 2urrent Size +ne.$ected Shutdo,ns +ser 'b3ects in Master

eneric
'b3ect Prefi.es 'b3ect Suffi.es

T-!"#
2ursor %'R +P"AT- column list 2ursor +sa*e -.$licit /nde. 2reation /&S-RT 2olumn List &ested Tri**ers 2onfi*uration &'2'+&T '$tion in Tri**ers &+LL 2om$arisons Results in Tri**ers Sco$in* of Transactions S-L-2T : S-T '$tions Tem$ Table +sa*e T'P ,ithout 'R"-R B; +se of Schema Qualified Tables<4ie,s

!"# !erver $%%& Readiness


/nvalid +ser Tables 'bsolete "B22 2ommands 'bsolete s$(confi*ure 2ommands 'bsolete Stored Procedures 'bsolete System Tables 'R"-R B; ,ith constants 9Sys9 +ser Schema =/T> >int S$ecification

Rule 'nformation

Rule( Affinity )ask


Category
2onfi*uration '$tions

Description
This rule chec#s if 2P+ affinity is confi*ured in such a ,ay that not all $rocessors are used! /n most cases the affinity mask confi*uration o$tion $rovides best $erformance ,hen set to 0 ?the default@! SQL Server $rocessor affinity is a s$ecialized o$erationA it is recommended that SQL Server $rocessor affinity be used only ,hen necessary! /n most casesB the default affinity $rovides the best $erformance!

*arameters
&one

Additional 'nformation
affinity mas# '$tion ?Administerin* SQL Server ?SQL Server@@

Rule( Allo+ ,pdates -nabled


Category
2onfi*uration '$tions

Description
This rule chec#s that u$dates to the system catalo* are not enabled! The allo+ updates o$tion is used to s$ecify ,hether direct u$dates can be made to system tables! By defaultB allo+ updates is disabled ?set to 0@B so users cannot u$date system tables throu*h ad hoc u$dates! +sers can u$date system tables usin* system stored $rocedures only! =hen allo+ updates is enabled ?set to @B any user ,ho has a$$ro$riate $ermissions can u$date system tables directly ,ith ad hoc u$dates and can create stored $rocedures that u$date system tables! +$datin* fields in system tables can $revent an instance of MicrosoftC SQL ServerD from runnin* or can cause data loss! )iven that system tables are critical to the o$eration of SQL ServerB enable allo+ updates only in ti*htly controlled situations!

*arameters
&one

Additional 'nformation
allo, u$dates '$tion ?Administerin* SQL Server ?SQL Server@@

Rule( Auto Creation of !tatistics


Category
"atabase Administration

Description
This rule chec#s ,hether databases have EAuto 2reation of StatisticsE and EAuto +$date of StatisticsE enabled or not! Thou*h some cases may benefit from havin* these o$tions offB it is *enerally recommended to #ee$ them on! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation
Settin* "atabase '$tions ?2reatin* and Maintainin* "atabases ?SQL Server@@ Statistical /nformation ?2reatin* and Maintainin* "atabases ?SQL Server@@

Rule( A.s and !evere -rrors


Category
)eneral Administration

Description
This rule chec#s the &T -vent lo*B fla**in* any Access 4iolations ?A4s@ or Severe -rrors ,ithin the last G number of days ?H0 days by default@! -rrors ,ith severity bet,een I and 2J are re$orted! Severity levels from I throu*h 2J indicate soft,are or hard,are errors! The system administrator should be informed ,henever $roblems that *enerate errors ,ith severity levels I and hi*her occur!

*arameters

/umber of DaysF an inte*er value re$resentin* the number of days to scan for severe errors! "efaultF H0 days!

Additional 'nformation
-rror Messa*e Severity Levels ?Troubleshootin* ?SQL Server@@

Rule( CR-AT- DATABA!- +it0 FOR #OAD


Category
"e$recation

Description
This rule chec#s stored $roceduresB functionsB vie,s and tri**ers for use of 2R-AT- "ATABASstatement s$ecifyin* the %'R L'A" clause! %'R L'A" clause has been de$recated and ,ill not be su$$orted in a future release of SQL Server! R-ST'R- statement $rovides o$tion to recreate a database!

This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! Scans trace files associated ,ith a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation
2R-AT- "ATABAS- statement

Rule( Cursor FOR ,*DAT- column list


Category
T5SQL

Description
This rule chec#s stored $roceduresB functionsB vie,s and tri**ers for correct s$ecification of column list on usa*e of %'R +P"AT- clause! =hen a cursor is declared ,ith a %'R +P"AT- clauseB it is recommended to s$ecify a column list! This rule fla*s such missin* column lists! SQL Server can o$timize o$erations based on column list information available! A future release may have ti*hter re1uirements on s$ecification of u$datable columns!

This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! Scans trace files associated ,ith a re*istered SQL Server instance!

"oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation
"-2LAR- 2+RS'R statement

Rule( Cursor ,sage


Category
T5SQL

Description
This rule chec#s stored $roceduresB functionsB vie,s and tri**ers for correct declaration of cursor u$datability based on a$$arent usa*e! This rule re$orts failure ,hen a cursor is declared ,ithout a %'R +P"AT- clause and u$dates are done throu*h the cursorB or ,hen a cursor is declared ,ith a %'R +P"AT- clause and no u$dates occur throu*h the cursor!

This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! Scans trace files associated ,ith a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation
"-2LAR- 2+RS'R statement

Rule( Database Backups


Category
Bac#u$ and Recovery

Description
This rule chec#s that each database ?e.ce$t if read5only@ is bac#ed u$ in the last G number of days ?H0 days by default@!

/t is recommended that databases that are not read5only be bac#ed u$ often to minimize loss of critical data incase of failure! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters

/umber of DaysF an inte*er value re$resentin* the number of days to scan for database bac#u$s! "efaultF H0 days!

Additional 'nformation
Bac#in* +$ and Restorin* "atabases ?Administerin* SQL Server ?SQL Server@@

Rule( Database Compatibility #evel


Category
"atabase Administration

Description
This rule chec#s that all databases on the server are runnin* under the latest com$atibility mode! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation
s$(dbcm$tlevel ?Transact5SQL Reference ?SQL Server@@

Rule( Database Disk !pace


Category
"atabase Administration

Description
This rule chec#s database *ro,th confi*uration and available dis# s$ace! /t chec#s and re$orts if any database files are ,ithin GK ?default is JK@ of reachin* their ma.imum size ?if s$ecified@!

This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters

Cutoff *ercentage !i1eF an inte*er value bet,een and LL re$resentin* the cutoff $ercenta*e to use ,hen scannin* database files for bein* ,ithin GK of reachin* their ma.imum size! "efaultF JK!

Additional 'nformation
-.$andin* a "atabase ?2reatin* and Maintainin* "atabases ?SQL Server@@

Rule( Database File Compression


Category
"atabase Administration

Description
This rule chec#s all databases to ensure that data and lo* files are not on a com$ressed volume and in an &T%S $artition! "atabase or file*rou$s that are read5only are not scanned! MicrosoftC SQL ServerD 2000 data and transaction lo* files must not be $laced on com$ressed file systems or a remote net,or# driveB such as a shared net,or# directory! /t is recommended that data and lo* files are $laced in an &T%S $artition! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation
2reatin* a "atabase ?2reatin* and Maintainin* "atabases ?SQL Server@@

Rule( Database File *lacement


Category
"atabase Administration

Description

This rule chec#s that data and lo* files are not $laced on the same lo*ical drive! This is a *eneral recommendation that hel$s se$arate /' for data $a*es from lo* o$erations! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation

Rule( Database !"# Options


Category
"atabase Administration

Description
This rule chec#s that the database SQL '$tions are confi*ured $ro$erly! SQL '$tions control A&S/ com$liance o$tions! The follo,in* database SQL '$tions should be '&F

A&S/(&+LLS A&S/(PA""/&) A&S/(=AR&/&)S AR/T>AB'RT 2'&2AT(&+LL(;/-L"S(&+LL Q+'T-"(/"-&T/%/-R

The follo,in* should be '%%F

&+M-R/2(R'+&"AB'+T

"atabase SQL '$tions should be confi*ured as recommended to remove de$recated behaviorsB be A&S/ com$liantB and be able to levera*e the full feature set ?inde.ed vie,s and inde.es on com$uted columns@! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation

Settin* "atabase '$tions ?2reatin* and Maintainin* "atabases ?SQL Server@@

Rule( Defaults and Rules


Category
"e$recation

Description
This rule chec#s stored $roceduresB functionsB vie,s and tri**ers for e.istence of defaults and rules! These ob3ects have been de$recated in favor of 2>-20 constraints and ,ill not be su$$orted in a future release of SQL Server!

This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation
2R-AT- "-%A+LT statement 2R-AT- R+L- statement

Rule( Deprecated Builtin Functions


Category
"e$recation

Description
This rule chec#s stored $roceduresB functionsB vie,s and tri**ers for use of builtin functions that have been de$recated from SQL Server! A future release of SQL Server ,ill not su$$ort these functionsF

"ATABAS-PR'P-RT; S+S-R(/" S+S-R(&AM-

This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! Scans trace files associated ,ith a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation

Rule( Duplicate Full-Text *redicates


Category
%ull5Te.t

Description
This rule chec#s stored $roceduresB tri**ersB vie,s and functions for use of du$licate full te.t $redicates ?CO/TA'/! or FR--T-2T@ o$eratin* on the same column in the same 1uery! As an e.am$leB the follo,in* 1ueryF S-L-2T col %R'M dbo!tab =>-R- 2'&TA/&S?ft(colB 9merry9@ or 2'&TA/&S ?ft(colB 9christmas9@ should be re,ritten asF S-L-2T col %R'M dbo!tab =>-R- 2'&TA/&S?ft(colB 9merry 'R christmas9@ The former 1uery $erforms t,o se$arate scans of the full5te.t catalo*B ,hile the latter does a sin*le $ass! Si*nificant $erformance im$rovements can be obtained by consolidatin* full5te.t $redicates! &oteF This rule $erforms only syntactic analysis! %or this reasonB it may re$ort false $ositives by considerin* t,o full5te.t $redicates o$eratin* on the same columnB ,hen the actual case may be that the $redicates o$erate on t,o different columns from different tables that ha$$en to have the same name! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! Scans trace files associated ,ith a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation
%ull5Te.t Search Recommendations

Rule( -rror #og !i1e


Category
)eneral Administration

Description
This rule chec#s if the error lo* size is too bi* i!e! *reater than J00 MB! The error lo* in SQL Server 2000 $rovides com$lete information about events in SQL Server! A ne, error lo* is created each time an instance of SQL Server is started and can sometimes *et very lar*e! /n such casesB it is recommended that the sp3cycle3errorlog system stored $rocedure be used to cycle the error lo* files ,ithout havin* to restart the instance of SQL Server!

*arameters
&one

Additional 'nformation
s$(cycle(errorlo* ?Transact5SQL Reference ?SQL Server@@

Rule( -xplicit 'ndex Creation


Category
TSQL

Description
This rule chec#s that creation of inde.es is done ,ith e.$licit s$ecification of inde. ty$e! Synta. for creatin* an inde. is as follo,sF 2R-AT- M +&/Q+- N M 2L+ST-R-" O &'&2L+ST-R-" N /&"-G index_nameN '& P tableviewQ 4 column M AS2 O "-S2 N M B!!!n N 5 M =/T> R inde.(o$tion S M B!!!nN N M '& filegroup N R inde.(o$tion S FF 7 P PA"(/&"-G O %/LL%A2T'R 6 fillfactor O /)&'R-("+P(0-; O "R'P(-G/ST/&) O STAT/ST/2S(&'R-2'MP+T- O S'RT(/&(T-MP"B Q /t is recommended that the 2L+ST-R-" or &'&2L+ST-R-" s$ecifications be used ?as a$$ro$riate@ ,hen creatin* an inde.! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! Scans trace files associated ,ith a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation
2R-AT- /&"-G ?Transact5SQL Reference ?SQL Server@@

Rule( Failed Backups


Category
Bac#u$ and Recovery

Description
This rule chec#s the &T -vent Lo* for failed bac#u$ o$erations ,ithin the last G number of days ?H0 days by default@! %ailed bac#u$s should be investi*ated! There may be increased ris# of losin* critical data incase of failure if bac#u$ information is not available at restore time!

*arameters

/umber of DaysF a $ositive inte*er value re$resentin* the number of days to scan for failed bac#u$s! "efaultF H0 days!

Additional 'nformation
Bac#in* +$ and Restorin* "atabases ?Administerin* SQL Server ?SQL Server@@

Rule( Fiber mode


Category
2onfi*uration '$tions

Description
This rule chec#s if Li*ht,ei*ht Poolin* is confi*ured in such a ,ay that fibers are turned on! /n most cases the lig0t+eig0t pooling confi*uration o$tion $rovides best $erformance ,hen set to 0 ?default@! SQL Server li*ht,ei*ht $oolin* is a s$ecialized o$erationA it is recommended that it is used only ,hen strictly necessary! /n most cases default value ?0@ $rovides the best results!

*arameters

&one

Additional 'nformation
Li*ht,ei*ht Poolin* '$tion ?Administerin* SQL Server ?SQL Server@@ +sin* the li*ht,ei*ht $oolin* '$tion

Rule( Full-Text Background !ervices Optimi1ed


Category
%ull5Te.t

Description
This rule chec#s that the server is o$timized for bac#*round a$$lications to facilitate $erformance of full5te.t services! Processin* time for the full5te.t search service can be im$roved by settin* u$ the server to run fore*round and bac#*round a$$lications ,ith e1ual $riority! SQL ServerB ,hich runs as a bac#*round a$$licationB then runs at e1ual $riority to other a$$lications runnin* in the fore*round! This rule is a$$licable only for servers ,ith full5te.t enabled for one or more databases!

*arameters
&one

Additional 'nformation
2onfi*urin* Server Tas#in* ?'$timizin* "atabase Performance ?SQL Server@@ %ull5Te.t Search Recommendations ?Troubleshootin* ?SQL Server@@

Rule( Full Text B#OB -xtension Type


Category
%ull5Te.t

Description
This rule chec#s that the BL'B e.tension column should not be of ty$e c0ar or nc0ar for tables ,ith full5te.t enabled on a BL'B column ?i!e! ima*e data ty$e@! /t is recommended that the ty$e for the BL'B e.tension column be varc0ar or nvarc0ar to facilitate full5te.t search! The BL'B e.tension column is the column that contains the document ty$e of the BL'B column and is s$ecified usin* sp3fulltext3column system stored $rocedure! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! 'nly scans databases that are full5te.t enabled! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation
Buildin* Search A$$lications for the =eb +sin* Microsoft SQL Server 2000 %ull5Te.t Search s$(fullte.t(column ?Transact5SQL Reference ?SQL Server@@

Rule( Full Text Catalog Count


Category
%ull5Te.t

Description
This rule chec#s if the server instance has more than 20 catalo*s and ,arns user that there are too many catalo*s! %or o$timal full5te.t $erformance it is recommended that the catalo* count be #e$t lo,! A ma.imum of 2JT full5te.t catalo*s can be created on each server! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! 'nly scans databases that are full5te.t enabled! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation
%ull5Te.t /nde.es ?2reatin* and Maintainin* "atabases ?SQL Server@@ %ull5Te.t Search Recommendations ?Troubleshootin* ?SQL Server@@

Rule( Full Text Catalog *lacement


Category
%ull5Te.t

Description

This rule chec#s that full5te.t catalo*s are not $laced on the same drive as the data! As a best $ractice %ull5Te.t catalo*s should be created on their o,n $hysical drive ?or drives@B if $ossible! )iven the $rocess of buildin* a %ull5Te.t inde. is relatively /<' intensive ?on a hi*h levelB it consists of readin* data from SQL ServerB and then ,ritin* the inde. to the file system@B it is recommended to avoid lettin* the /<' subsystem become a bottlenec#! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! 'nly scans databases that are full5te.t enabled! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation
Buildin* Search A$$lications for the =eb +sin* Microsoft SQL Server 2000 %ull5Te.t Search

Rule( Full-Text C0ange Tracking -nabled


Category
%ull5Te.t

Description
This rule chec#s that chan*e trac#in* is enabled for all tables that have full5te.t enabled! 2han*e trac#in* $o$ulation maintains a record of the ro,s that have been modified in a system tableB and $ro$a*ates the chan*es to the full5te.t inde.! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation
%ull5Te.t /nde.in* Su$$ort ?SQL Server Architecture ?SQL Server@@ Maintainin* %ull5Te.t /nde.es ?2reatin* and Maintainin* "atabases ?SQL Server@@

Rule( Full Text *roperty !tore !i1e


Category
%ull5Te.t

Description
This rule chec#s that the $ro$erty store files ?:!$s and :!$s2@ for MS Search are not lar*er than 2JTMB! Performance can be im$roved by increasin* the ma.imum size of the $ro$erty store in cases ,here files have e.ceeded the confi*ured limit! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation
%ull5Te.t Search "e$loyment

Rule( 'ndex Fragmentation


Category
"atabase Administration

Description
This rule chec#s ,hether inde. fra*mentation is too hi*h ?over a s$ecified $ercenta*eB default is 20K@ for inde.es ,ith more than 0B000 $a*es ?default value@! As Microsoft SQL Server 2000 maintains inde.es to reflect u$dates to their underlyin* tablesB these inde.es can become fra*mented! "e$endin* on ,or#load characteristicsB this fra*mentation can adversely affect ,or#load $erformance! "e$endin* on de$loyment environmentB defra*mentation of inde.es can benefit ,or#load $erformance! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters

/umber of *agesF an inte*er indicatin* the minimum number of $a*es that an inde. must have to be included in the scan! "efaultF 0B000 $a*es! )ax FragmentationF a number bet,een 0 and 00 indicatin* the ma.imum acce$table fra*mentation $ercenta*e for an inde.! "efaultF 20!

Additional 'nformation
Microsoft SQL Server 2000 /nde. "efra*mentation Best Practices "B22 S>'=2'&T/) Statement

"B22 /&"-G"-%RA) Statement

Rule( '/!-RT Column #ist


Category
T5SQL

Description
This rule chec#s ob3ects for use of /&S-RT statements ,ithout e.$licit s$ecification of tar*et column list! =hen insertin* into a table or vie,B it is recommended that the tar*et column_list be e.$licitly s$ecified! This results in more maintainable code! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! Scans trace files associated ,ith a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation
/&S-RT ?Transact5SQL Reference ?SQL Server@@

Rule( 'nvalid ,ser Tables


Category
SQL Server 200J Readiness

Description
This rule chec#s that user tables ?.ty$e79+9@ named dbo!sys$ro$erties and dbo!sysfullte.tnotify do not e.ist in s$ecified databases! SQL Server 200J has chan*ed the ,ay that these system tables are used! /n order to avoid data lossB u$*rade of a database containin* either of these invalid user tables ,ill be aborted! System tables ?.ty$e79S9@ of the same name ,ill not cause any $roblems! /f a database contains either of these user tablesB they should be renamed or removed $rior to u$*radin*! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters

&one

Additional 'nformation

Rule( #og File ro+t0


Category
"atabase Administration

Description
This rule chec#s to see ,hether *ro,th $olicy for lo* file is ade1uate! An ade1uate *ro,th $olicy ,ill reduce the number of lo* file *ro,th o$erationsB minimizin* the number of virtual lo* files created! /t is recommended that lo* file *ro,th be set as a $ercenta*e or accordin* to the follo,in* limitsF =hen lo* file is confi*ured for fi.ed *ro,thB it should be set to *ro, by at least JK of the current size of the file or a TUMB increment! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation
Physical "atabase %iles and %ile*rou$s ?SQL Server Architecture ?SQL Server@@

Rule( )aster and )!DB Backup


Category
Bac#u$ and Recovery

Description
This rule chec#s that the Master and MS"B databases have been bac#ed u$ in the last G number of days ?H0 days by default@! The Master and MS"B databases contain critical system information and should be bac#ed u$ often!

*arameters

/umber of DaysF an inte*er value re$resentin* the number of days to scan for database bac#u$s! "efaultF H0 days!

Additional 'nformation

System "atabases and "ata ?SQL Server Architecture ?SQL Server@@ Bac#in* +$ and Restorin* "atabases ?Administerin* SQL Server ?SQL Server@@

Rule( )ax !erver )emory


Category
2onfi*uration '$tions

Description
This rule chec#s that the max server memory o$tion has been set to default ?2 UIUVHTUI MB@ unlessF

A7- is enabledF /nstances of SQL Server 2000 do not dynamically mana*e the size of the address s$ace ,hen A=- memory is enabled! SQL Server ,ill reserve and loc# almost all available memory ?or the value of max server memory if the o$tion has been set@ ,hen the server is started! Full-Text !earc0 is enabledF /f full5te.t search is enabledB confi*ure the SQL Server max server memory o$tion such that there is sufficient virtual memory left to satisfy this %ull5 Te.t Search memory re1uirement!

&oteF There may still be other cases ,here settin* ma. server memory may be re1uiredB such as ,hen there are multi$le instances of SQL Server or the server is hostin* other a$$lications!

*arameters
&one

Additional 'nformation
Server Memory '$tions ?Administerin* SQL Server ?SQL Server@@ Mana*in* A=- Memory ?Administerin* SQL Server ?SQL Server@@ -ffects of min and ma. server memory ?SQL Server Architecture ?SQL Server@@

Rule( )!!earc0 !ervice Account


Category
%ull5Te.t

Description
This rule chec#s that the MSSearch service is runnin* as Local System! This rule is a$$licable only for servers ,ith full5te.t enabled for one or more databases!

*arameters

&one

Additional 'nformation

Rule( /ested Triggers Configuration


Category
TSQL

Description
This rule chec#s for tri**ers that may not be firin* due to 9nested tri**ers9 confi*uration o$tion settin*! =hen 9nested tri**ers9 confi*uration o$tion is set to 0B any A%T-R tri**er defined on tables<vie,s u$dated inside an /&ST-A" '% tri**er is not fired! This ruleF

@ 2hec#s the value of the confi*uration o$tion and e.its if it is not 0! 2@ Scans all /&ST-A" '% tri**ers and *enerates a list of tables<vie, bein* tar*et of "ML from ,ithin a tri**er! H@ 2hec#s ,hether any of the identified "ML tar*ets have A%T-R tri**ers defined on them! U@ Re$orts non5com$liance for any such case!

"e$endin* on a$$lication desi*nB the condition identified by this rule may lead to incorrect a$$lication semantics! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation

Rule( /O3#O #og Backups


Category
Bac#u$ and Recovery

Description
This rule chec#s the &T -vent Lo* for e.ecutions of bac#u$ ,ith &'(L') ,ithin the last G number of days ?H0 days by default@! The &'(L') and TR+&2AT-('&L; clauses of BA20+P remove the inactive $art of the lo* ,ithout ma#in* a bac#u$ co$y of it and truncate the lo*!

BA20+P o$erations ,ith &'(L') are discoura*ed!

*arameters

/umber of DaysF a $ositive inte*er value re$resentin* the number of days to scan for bac#u$s ,ith &'(L')! "efaultF H0 "ays!

Additional 'nformation
Truncatin* the Transaction Lo* ?SQL Server Architecture ?SQL Server@@

Rule( /OCO,/T Option in Triggers


Category
TSQL

Description
This rule scans tri**ers to ensure they S-T &'2'+&T to '& at the be*innin*! SQL Server sends 9done9 to#en information for each statement that com$letes e.ecution! -.tra to#ens may cause une.$ected results in a$$lication code e.ecutin* o$erations that caused the tri**er to fire! /t is *eneral *ood desi*n to have &'2'+&T set to '& ,ithin a tri**er! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation

Rule( /on-A/!' Outer 8oins


Category
"e$recation

Description
This rule chec#s for the use of non5A&S/ outer 3oins! ?:7 and 7: synta.@ 6oins are s$ecified in the %R'M clause in "-L-T-B S-L-2TB and +P"AT- statements! Synta. is as follo,sF M %R'M P R table(source S Q M 9!!!n N N

R table(source S FF7 table_name M M AS N table_alias N M =/T> 4 R table(hint S M 9!!!n N 5 N O view_name M M AS N table_alias N M =/T> 4 R vie,(hint S M 9!!!n N 5 N O rowset_function M M AS N table_alias N O user_defined_function M M AS N table_alias N O derived_table M AS N table_alias M ? column_alias M 9!!!n N @ N O R 3oined(table S R 3oined(table S FF7 R table(source S R 3oin(ty$e S R table(source S '& R search(condition S O R table(source S 2R'SS 6'/& R table(source S O M ? N R 3oined(table S M @ N R 3oin(ty$e S FF7 M /&&-R O P P L-%T O R/)>T O %+LL Q M '+T-RN Q N M R 3oin(hint S N 6'/& /t is recommended that outer 3oins use the A&S/ s$ecified synta.B for e.am$leF S-L-2T : %R'M tab L-%T '+T-R 6'/& tab2 '& tab !cH 7 tab2!cH R/)>T '+T-R 6'/& tabH L-%T '+T-R 6'/& tabU '& tabH!c 7 tabU!c '& tab2!cH 7 tabU!cH This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! Scans trace files associated ,ith a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation
%R'M ?Transact5SQL Reference ?SQL Server@@

Rule( /,## ::servername


Category
)eneral Administration

Description
This rule chec#s that ::!-R.-R/A)- does not return &+LL! /n some cases 88S-R4-R&AMbecomes &+LL and can cause $roblems!

*arameters

&one

Additional 'nformation
88S-R4-R&AM- ?Transact5SQL Reference ?SQL Server@@

Rule( /,## Comparisons


Category
TSQL

Description
This rule scans stored $roceduresB vie,sB functions and tri**ers to fla* use of e1uality and ine1uality com$arisons involvin* a &+LL constant! These com$arisons are undefined ,hen A&S/(&+LLS o$tion is set to '&! /t is recommended to set A&S/(&+LLS to '& and use the /S #ey,ord to com$are a*ainst &+LL constants! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! Scans trace files associated ,ith a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation
&ull 2om$arison Search 2onditions

Rule( Ob;ect *refixes


Category
)eneric

Description
This rule chec#s that all ob3ects of ty$e X are $refi.ed ,ith strin* Y on a s$ecified list of databases! The rule re$orts all ob3ects of ty$e X in the s$ecified databases that do not have the $refi. Y in their names! This rule is a *eneric rule to create best $ractices a$$licable to individual $roduction environments and enforce custom *uidelines! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters

Ob;ect Type to !can 4mandatory5F A strin* re$resentin* an ob3ect ty$e to scan! +se any one of the follo,in* ob3ect ty$esF C 7 2>-20 constraint D 7 "efault or "-%A+LT constraint F 7 %'R-/)& 0-; constraint F/ 7 Scalar function 'F 7 /nlined table5function # 7 Lo* * 7 Stored $rocedure *< 7 PR/MAR; 0-; constraint R 7 Rule RF 7 Re$lication filter stored $rocedure ! 7 System table TF 7 Table function TR 7 Tri**er , 7 +ser table ," 7 +&/Q+- constraint . 7 4ie, 2 7 -.tended stored $rocedure! -.am$leF -nter , to scan for user tables

Recommended *refix for Ob;ect 4mandatory5 F A strin* that should be a $refi. for every ob3ect name of s$ecified ty$e! -.am$leF -nter TB#3 if all table names should have $refi. TBL(!

Additional 'nformation
&one

Rule( Ob;ect !uffixes


Category
)eneric

Description
This rule chec#s that all ob3ects of ty$e X are suffi.ed ,ith strin* Y on a s$ecified list of databases! The rule re$orts all ob3ects of ty$e X in the s$ecified databases that do not have the suffi. Y in their names! This rule is a *eneric rule for the user to create best $ractices a$$licable to their s$ecific $roduction environment and *uidelines! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance!

"oes not chec# databases that are not online!

*arameters

Ob;ect Type to !can 4mandatory5F A strin* re$resentin* an ob3ect ty$e to scan! +se any one of the follo,in* ob3ect ty$esF C 7 2>-20 constraint D 7 "efault or "-%A+LT constraint F 7 %'R-/)& 0-; constraint F/ 7 Scalar function 'F 7 /nlined table5function < 7 PR/MAR; 0-; or +&/Q+- constraint # 7 Lo* * 7 Stored $rocedure *< 7 PR/MAR; 0-; constraint R 7 Rule RF 7 Re$lication filter stored $rocedure ! 7 System table TF 7 Table function TR 7 Tri**er , 7 +ser table ," 7 +&/Q+- constraint . 7 4ie, 2 7 -.tended stored $rocedure! -.am$leF -nter , to scan for user tables

Recommended !uffix for Ob;ect 4mandatory5 F A strin* that should be a suffi. for every ob3ect name of s$ecified ty$e! -.am$leF -nter 3TB# if all table names should have suffi. (TBL!

Additional 'nformation
&one

Rule( Obsolete DBCC Commands


Category
SQL Server 200J Readiness

Description
This rule chec#s for the use of "B22 commands that have been de$recated from SQL Server! A future release of SQL Server ,ill not su$$ort these "B22 commandsF

"B22 "B22 "B22 "B22 "B22

"BR-PA/R &-=ALL'2 P/&TABLR'=L'20 T-GTALL

"B22 T-GTALL'2 "B22 +&P/&TABL-

This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! Scans trace files associated ,ith a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation

Rule( Obsolete sp3configure Commands


Category
SQL Server 200J Readiness

Description
This rule chec#s for the use of s$(confi*ure commands that have been de$recated from SQL Server! A future release of SQL Server ,ill not su$$ort these s$(confi*ure commandsF

s$(confi*ure 9allo, u$dates9 s$(confi*ure 9o$en ob3ects9 s$(confi*ure 9set ,or#in* set size9

This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! Scans trace files associated ,ith a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation

Rule( Obsolete !tored *rocedures


Category
SQL Server 200J Readiness

Description

This rule chec#s for the use of stored $rocedures that are obsolete in SQL Server 200J! A future release of SQL Server ,ill not su$$ort these stored $roceduresF

s$(articlesynctran$rocs s$(dis#default s$(hel$lo* s$(hel$s1l s$(scri$tdynamicu$d$roc

This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! Scans trace files associated ,ith a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation

Rule( Obsolete !ystem Tables


Category
SQL Server 200J Readiness

Description
This rule chec#s for the use of system tables that have been de$recated from SQL Server! A future release of SQL Server ,ill not su$$ort these system tablesF

sysloc#s sys$ro$erties sys.lo*ins

This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! Scans trace files associated ,ith a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation

Rule( ORD-R B= +it0 constants

Category
SQL Server 200J Readiness

Description
This rule chec#s stored $roceduresB functionsB vie,s and tri**ers for use of 'R"-R B; clause s$ecifyin* constants as sort columns! /nte*ers are not re$orted! Su$$ort for this synta. has been de$recated and ,ill not be su$$orted in SQL Server 200J under L0 com$atibility level! As an e.am$leB the follo,in* synta. is not recommendedF S-L-2T au(id %R'M dbo!authors 'R"-R B; 9a9B null This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! Scans trace files associated ,ith a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation

Rule( *riority Boost -nabled


Category
2onfi*uration '$tions

Description
This rule chec#s that the priority boost o$tion is not enabled! The priority boost o$tion is used to s$ecify ,hether MicrosoftC SQL ServerD should run at a hi*her schedulin* $riority than other $rocesses on the same com$uter! /t is recommended that priority boost o$tion is not enabled! priority boost should be used only on a com$uter dedicated to SQL ServerB and ,ith a symmetric multi$rocessor ?SMP@ confi*uration!

*arameters
&one

Additional 'nformation
$riority boost '$tion ?Administerin* SQL Server ?SQL Server@@

Rule( Recovery 'nterval

Category
2onfi*uration '$tions

Description
This rule chec#s to see if recovery interval is set too hi*h! Too hi*h a recovery interval can lead to lon* server startu$ times! Recovery interval of 0 or is acce$table! The recovery interval o$tion is used to set the ma.imum number of minutes $er database that MicrosoftC SQL ServerD needs to recover databases! This confi*uration o$tion sets an u$$er limit on the time it should ta#e to recover each database! The default is 0B indicatin* automatic confi*uration by SQL Server! /t is recommended that recovery interval is set to 0 ?self5confi*urin*@ unless fre1uent chec#$oints are noticeably im$airin* $erformance! /n such a caseB increase the value of recovery interval in small increments!

*arameters
&one

Additional 'nformation
recovery interval '$tion ?Administerin* SQL Server ?SQL Server@@

Rule( Recovery )odel ,sage


Category
Bac#u$ and Recovery

Description
This rule chec#s each database and ,arns if recovery mode is full or bul#5lo**ed and the transaction lo* has not been bac#ed u$ ,ithin the last G number of days ?default is H0@! /t is recommended that the transaction lo* for databases usin* full or bul#5lo**ed recovery models should be bac#ed u$ to minimize critical data loss incase of any system or server failures! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! "oes not chec# databases that are not online! "oes not chec# read5only databases!

*arameters

/umber of DaysF a $ositive inte*er value re$resentin* the number of days to scan for lo* bac#u$s! "efaultF H0 "ays!

Additional 'nformation

Bac#in* +$ and Restorin* "atabases ?Administerin* SQL Server ?SQL Server@@ +sin* Recovery Models ?Administerin* SQL Server ?SQL Server@@ Selectin* a Recovery Model ?Administerin* SQL Server ?SQL Server@@

Rule( Results in Triggers


Category
TSQL

Description
This rule scans tri**ers to ensure they do not send data bac# to the caller! A$$lications that modify tables or vie,s ,ith tri**ers do not necessarily e.$ect results to be returned as $art of the modification o$eration! %or this reason it is not recommended to return results from ,ithin tri**ers! This rule fla*s as not recommended the use of the follo,in* statements ,ithin a tri**erF

PR/&T statement S-L-2T ?,ithout assi*nment or /&T' clause@ %-T2> ?,ithout assi*nment@

This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation

Rule( Reuse of Backup File


Category
Bac#u$ and Recovery

Description
This rule chec#s ,hether the last three bac#u$ o$erations on a database have been $erformed to the same file s$ecifyin* that e.istin* media should be over,ritten ?/&/T@! /f soB ,arns that there may be $otential ris# of data loss if bac#u$ files are not bein* co$ied bet,een bac#u$s! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! "oes not chec# databases that are not online!

'nly re$orts non com$liance on bac#u$ o$erations $erformed to dis# files!

*arameters
&one

Additional 'nformation
Bac#in* +$ and Restorin* "atabases ?Administerin* SQL Server ?SQL Server@@

Rule( !coping of Transactions


Category
T5SQL

Description
This rule chec#s stored $rocedures and tri**ers for a$$ro$riate sco$in* of transactions! /t is *enerally recommended to have transactions start and end ,ithin the same T5SQL frame! As an e.am$leB if a stored $rocedure does some ,or# and then calls 2'MM/T TRA&B callers of such $rocedure need to be intimate to the transaction semantics of the $rocedure! A caller una,are of the contract may *et s$urious error or incorrect isolation semantics! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation

Rule( !-#-CT >


Category
T5SQL

Description
This rule chec#s stored $roceduresB functionsB vie,s and tri**ers for use of ?>? in column lists of S-L-2T statements! Thou*h use of 9:9 is convenientB it may lead to less maintainable a$$lications! 2han*es to table or vie, definitions may cause errors or chan*es in $erformance! As an e.am$leB the follo,in* synta. is not recommendedF S-L-2T : %R'M dbo!authors

/t is recommended to have an e.$licit list ,henever the column to retrieve are #no,n to the a$$lication! S-L-2T a!au(idB a!au(lname %R'M dbo!authors a

This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! Scans trace files associated ,ith a re*istered SQL Server instance! "oes not chec# databases that are not online! "oes not scan usa*e of 9:9 in sub1ueries! ?e!*! -G/STS clause@ "oes not scan usa*e of 9:9 in a**re*ate functions 2'+&T?:@B 2'+&T(B/)?:@! "oes not scan usa*e of 9:9 in B/&AR;(2>-20S+M intrinsic function!

&oteF BPA does not detect usa*e of 9:9 inside inline table5valued functionsA ho,ever it is still a discoura*ed use of 9:9!

*arameters
&one

Additional 'nformation

Rule( !-T Options


Category
T5SQL

Description
This rule chec#s stored $rocedures and tri**ers for use of S-T statements settin* the follo,in* set o$tionsF The follo,in* o$tions are recommended to be '&F

A&S/(&+LLS A&S/(PA""/&) A&S/(=AR&/&)S AR/T>AB'RT 2'&2AT(&+LL(;/-L"S(&+LL Q+'T-"(/"-&T/%/-R

The follo,in* is recommended to be '%%F

&+M-R/2(R'+&"AB'+T

A S-T statement that sets one of the above o$tions to a not recommended value is fla**ed by this rule! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! Scans trace files associated ,ith a re*istered SQL Server instance! "oes not chec# databases that are not online! "oes not re$ort settin* of Q+'T-"(/"-&T/%/-R ,ithin a stored $rocedure since such a command is i*nored by SQL Server ,hen e.ecutin* the stored $rocedure!

*arameters
&one

Additional 'nformation

Rule( !et +orking set si1e Disabled


Category
2onfi*uration '$tions

Description
This rule chec#s that the set +orking set si1e o$tion is not enabled if SQL Server is allo,ed to use memory dynamically! The set +orking set si1e o$tion is used to reserve $hysical memory s$ace for MicrosoftC SQL ServerD that is e1ual to the server memory settin*! The server memory settin* is confi*ured automatically by SQL Server based on ,or#load and available resources! /t ,ill vary dynamically bet,een min server memory and max server memory! Settin* set +orking set si1e $revents the o$eratin* system from s,a$$in* out SQL Server $a*es thou*h they could be used by another $rocess ,hen SQL Server is idle! /t is recommended that the set +orking set si1e is not set if SQL Server is confi*ured to use memory dynamically!

*arameters
&one

Additional 'nformation
set ,or#in* set size '$tion ?Administerin* SQL Server ?SQL Server@@ Server Memory '$tions ?Administerin* SQL Server ?SQL Server@@

Rule( !-T,!-R usage


Category
"e$recation

Description

This rule chec#s stored $roceduresB functionsB vie,s and tri**ers for use of S-T+S-R statement! /n *eneralB S-T+S-R is not recommended! Su$$ort for this statement has been de$recated and ,ill not be su$$orted in a future release of SQL Server!

This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! Scans trace files associated ,ith a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation
S-T+S-R statement

Rule( !tring 6 -xpression Aliasing


Category
"e$recation

Description
This rule chec#s stored $roceduresB functionsB vie,s and tri**ers for use of column aliasin* ,here the name of the e.$ression uses a strin* value! /t is recommended to use 1uoted identifiers instead! Strin* aliases ,ill not be su$$orted in a future release of SQL Server! As an e.am$leB the follo,in* synta. is not recommendedF S-L-2T 9alias(for(col97au(idWau(id %R'M dbo!authors Recommended alternatives areF S-L-2T au(idWau(id as Ealias(for(colE %R'M dbo!authors S-L-2T au(idWau(id as alias(for(col %R'M dbo!authors S-L-2T au(idWau(id as Malias(for(colN %R'M dbo!authors

This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! Scans trace files associated ,ith a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters

&one

Additional 'nformation

Rule( ?!ys? ,ser !c0ema


Category
SQL Server 200J Readiness

Description
This rule chec#s that a schema called 9sys9 has not been defined! SQL Server 200J has rearchitected its system catalo* to be better or*anized and to e.$ose metadata information in a consistent ,ayB ,ithout forcin* users to see and understand im$lementation details of the catalo* itself! As $art of this effortB all system ob3ects have been moved to a ne,ly reserved 9sys9 schema! As suchB e.istin* databases ,ith 9sys9 schema defined in them ,ill not be able to u$*rade to SQL Server 200J ,ithout first renamin* such schema! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation

Rule( Tables +it0out *rimary <eys or ,ni@ue Constraints


Category
"atabase "esi*n

Description
This rule scans databases to ensure that all tables have a $rimary #ey defined or have a column ,ith a +ni1ue 2onstraint defined! Tables that donXt have a Primary 0ey defined or a column ,ith a uni1ue constraint defined fail the scan! 'nly tables that fail the scan are re$orted! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation
PR/MAR; 0-; 2onstraints ?2reatin* and Maintainin* "atabases ?SQL Server@@ 2reatin* and Modifyin* PR/MAR; 0-; 2onstraints ?2reatin* and Maintainin* "atabases ?SQL Server@@

Rule( Temp Table ,sage


Category
T5SQL

Description
This rule chec#s stored $rocedures and tri**ers for usa*es of tem$orary tables that may be re$laced by use of table variables! This rule ,ill re$ort $rocedures ,here a tem$orary table is createdB no 2R-AT- /&"-G is issued on itB and it is dro$$edB all in the same $rocedure! These cases may consider usin* table variables instead and $otentially observe fe,er recom$ilations! &ote that if lar*e data volumes ,ill be inserted in the tem$orary table it may still be $referred to use tem$orary tables due to $arallel e.ecution restrictions and statistics maintenance! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! Scans trace files associated ,ith a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation
%re1uently As#ed Questions 5 SQL Server 2000 5 Table 4ariables

Rule( ?tempdb? Current !i1e


Category
)eneral Administration

Description
This rule chec#s that 9tem$db9 is not currently si*nificantly ? 0. times by default@ lar*er than the set default size! /f 9tem$db9 is usually si*nificantly lar*er than the default sizeB then the default size should be increased so that 9tem$db9 doesn9t have to *ro, at runtime every time the server is restarted!

*arameters

Acceptable !i1e RatioF an inte*er value re$resentin* the acce$table ratio of current to ori*inal size that should be chec#ed! "efaultF 0!

Additional 'nformation

Rule( Timestamp Column for Full-Text


Category
%ull5Te.t

Description
This rule chec#s that each full5te.t inde.ed table should have a timestam$ column to allo, for incremental $o$ulation! /ncremental $o$ulation only ad3usts inde. entries for ro,s addedB deletedB or modified after the last $o$ulation! This feature re1uires that the inde.ed table have a column of the timestam$ data ty$e! Re1uests for incremental $o$ulations on tables ,ithout timestam$ columns result in a full $o$ulation o$eration! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation
%ull5Te.t /nde.in* Su$$ort ?SQL Server Architecture ?SQL Server@@

Rule( TO* +it0out ORD-R B=


Category
T5SQL

Description
This rule chec#s stored $roceduresB functionsB vie,s and tri**ers for usa*es of T'P in 1ueries ,ithout an 'R"-R B; clause! This rule ,ill re$ort use of 1ueries ,here the T'P clause is s$ecified ,ithout an 'R"-R B; clause in the 1uery! /t is *enerally recommended to s$ecify sort criteria ,hen usin* T'P clause! 'ther,iseB the results $roduced ,ill be $lan de$endent and may lead to undesired behavior!

This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! Scans trace files associated ,ith a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation
Limitin* Result Sets +sin* T'P and P-R2-&T

Rule( ,nexpected !0utdo+ns


Category
)eneral Administration

Description
This rule chec#s the &T -vent Lo* and fla*s any une.$ected shutdo,ns that mi*ht have occurred ,ithin the last G number of days ?H0 days by default@! A $ossible une.$ected shutdo,n is re$orted if a server startB indicated by the follo,in* messa*eF I T2F SQL Server is startin* at $riority class!!! is not $receded by a valid server sto$ messa*eF I UVF SQL Server is terminatin* due to 9sto$9 re1uest from Service 2ontrol Mana*er! I UIF SQL Server terminatin* because of system shutdo,n!

*arameters

/umber of DaysF an inte*er value re$resentin* the number of days to scan for une.$ected shutdo,ns! "efaultF H0 "ays!

Additional 'nformation

Rule( ,se of !c0ema "ualified TablesA.ie+s


Category
T5SQL

Description

This rule chec#s stored $roceduresB functionsB vie,s and tri**ers for use of schema 1ualified names ,hen referencin* tables and vie,s! +nless s$ecified other,iseB all Transact5SQL references to the name of a database ob3ect can be a four5$art name in the formF M server_name!Mdatabase_nameN!Mschema_nameN! O database_name!Mschema_nameN! O schema_name! N N =hen referencin* a s$ecific ob3ectB it is not re1uired to s$ecify the serverB databaseB and o,ner ?schema@ for SQL Server to identify the ob3ect! >o,everB it is recommended that schema name be s$ecified to identify a table or vie, inside a stored $rocedureB functionB vie, or tri**er! =hen SQL Server loo#s u$ a table<vie, ,ithout a schema 1ualificationB it first searches the default schema and then the ?dbo? schema! The default schema corres$onds to the current user for ad5hoc batchesB and corres$onds to the schema of a stored $rocedure ,hen inside one! /n either caseB SQL Server incurs an additional runtime cost to verify schema bindin* of un1ualified ob3ects! A$$lications are more maintainable and may observe a sli*ht $erformance im$rovement if ob3ect references are schema 1ualified! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! Scans trace files associated ,ith a re*istered SQL Server instance! "oes not chec# databases that are not online! "oes not chec# schema 1ualification on tem$orary tables! "oes not chec# schema 1ualification on inserted<deleted $seudo tables inside tri**er definitions! Also re$orts missin* schema 1ualification on tar*et table<vie, of 2R-AT- TR/))-R statement!

This rule does not chec# for

*arameters
&one

Additional 'nformation
+sin* /dentifiers as 'b3ect &ames ?Accessin* and 2han*in* Relational "ata ?SQL Server@@ Transact5SQL Synta. 2onventions ?Transact5SQL Reference ?SQL Server@@

Rule( ,se of sp3dboption


Category
"e$recation

Description

This rule chec#s stored $roceduresB functionsB vie,s and tri**ers for use of s$(dbo$tion $rocedure! This stored $rocedure has been de$recated in favor of ALT-R "ATABAS- statement and ,ill not be su$$orted in a future release of SQL Server!

This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! Scans trace files associated ,ith a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation
s$(dbo$tion ?Transact5SQL Reference ?SQL Server@@

Rule( ,ser Ob;ect /aming


Category
"atabase "esi*n

Description
This rule chec#s for user ob3ects ,ith any of the follo,in* $refi.esF sp3B xp3B or fn3! Thou*h this $ractice is su$$ortedB it is recommended that the $refi.es not be used to avoid name clashes ,ith Microsoft shi$$ed ob3ectsF

sp3F this $refi. should not be used for user defined stored $rocedures xp3F this $refi. should not be used for user defined e.tended stored $rocedures fn3F this $refi. should not be used for user defined scalar functions

This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance in addition to 9master9 database! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation
System "atabases and "ata ?SQL Server Architecture ?SQL Server@@

Rule( ,ser Ob;ects in )aster

Category
)eneral Administration

Description
This rule chec#s to see if there are any user ob3ects in master database! The master database is reserved for SQL Server internal use and it is recommended that user ob3ects not be created in master database! This rule does not re$ort e.tended stored $rocedures or startu$ $roceduresB *iven that master is the only database ,here they can be created!

*arameters
&one

Additional 'nformation

Rule( .irtual #og File Count


Category
"atabase Administration

Description
This rule chec#s to see if there are too many virtual lo* files for each database on the server! -ach transaction lo* file is divided lo*ically into smaller se*ments called virtual lo* files! 4irtual lo* files are the unit of truncation for the transaction lo*! Too many virtual lo* files can slo, do,n bac#u$<restore and database startu$! /t is recommended that the virtual lo* file count should be less than 200! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation
4irtual Lo* %iles ?2reatin* and Maintainin* "atabases ?SQL Server@@ Shrin#in* the Transaction Lo* ?SQL Server Architecture ?SQL Server@@

Rule( 7'TB Bint !pecification

Category
SQL Server 200J Readiness

Description
This rule chec#s stored $roceduresB tri**ersB vie,s and functions for use of table hints ,ithout the 7'TB #ey,ord! /t is recommended that hints be s$ecified usin* the 7'TB #ey,ord! SQL Server 200J ,ill not su$$ort the use of more than one hints in a T5SQL statement unless the 7'TB #ey,ord is s$ecified! As an e.am$leB the follo,in* synta. is not su$$orted in SQL Server 200JF S-L-2T au(id %R'M dbo!authors ?+P"L'20B PA)L'20@ The recommended a$$roach is to useF S-L-2T au(id %R'M dbo!authors 7'TB ?+P"L'20B PA)L'20@ Queries s$ecifyin* a sin*le hint ,ill ,or# in SQL Server 200JB thou*h it is still recommended to use the =/T> #ey,ord! This ruleF

'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! Scans trace files associated ,ith a re*istered SQL Server instance! "oes not chec# databases that are not online!

*arameters
&one

Additional 'nformation
>ints ?Accessin* and 2han*in* Relational "ata ?SQL Server@@ 2o$yri*ht Y 200U Microsoft 2or$oration! All ri*hts reserved!

You might also like