Vous êtes sur la page 1sur 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@@

*DAT.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 .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 .s and tri**ers for correct s$ecification of column list on usa*e of %'R +P"AT.+it0 FOR #OAD Category "e$recation Description This rule chec#s stored $roceduresB functionsB vie.DATABA!.clause! =hen a cursor is declared .ith a re*istered SQL Server instance! "oes not chec# databases that are not online! *arameters &one Additional 'nformation 2R-AT.ith a %'R +P"AT.Rule( CR-AT.ill not be su$$orted in a future release of SQL Server! R-ST'R.statement Rule( Cursor FOR ."ATABAS.ith a re*istered SQL Server instance! .column list Category T5SQL Description This rule chec#s stored $roceduresB functionsB vie.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 .

hen a cursor is declared .2+RS'R statement Rule( Cursor .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 .• "oes not chec# databases that are not online! *arameters &one Additional 'nformation "-2LAR.ithout a %'R +P"AT.ith a re*istered SQL Server instance! "oes not chec# databases that are not online! *arameters &one Additional 'nformation "-2LAR.ce$t if read5only@ is bac#ed u$ in the last G number of days ?H0 days by default@! .s and tri**ers for correct declaration of cursor u$datability based on a$$arent usa*e! This rule re$orts failure .clause and u$dates are done throu*h the cursorB or .hen a cursor is declared .sage Category T5SQL Description This rule chec#s stored $roceduresB functionsB vie.ith a %'R +P"AT.2+RS'R statement Rule( Database Backups Category Bac#u$ and Recovery Description This rule chec#s that each database ?e.

ithin GK ?default is JK@ of reachin* their ma./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.imum size ?if s$ecified@! .th confi*uration and available dis# s$ace! /t chec#s and re$orts if any database files are .

$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.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 .ithin GK of reachin* their ma.hen scannin* database files for bein* .imum size! "efaultF JK! Additional 'nformation -.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 .or# driveB such as a shared net.

in* database SQL '$tions should be '&F • • • • • • A&S/(&+LLS A&S/(PA""/&) A&S/(=AR&/&)S AR/T>AB'RT 2'&2AT(&+LL(.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.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 .ed vie.s and inde./-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.

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.R+L.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.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."-%A+LT statement 2R-AT. S+S-R(/" S+S-R(&AM- .

t catalo*B .t Search Recommendations .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.s and functions for use of du$licate full te.hile the latter does a sin*le $ass! Si*nificant $erformance im$rovements can be obtained by consolidatin* full5te.hen the actual case may be that the $redicates o$erate on t.o se$arate scans of the full5te.t $redicates o$eratin* on the same columnB .am$leB the follo.t Description This rule chec#s stored $roceduresB tri**ersB vie.t $redicates! &oteF This rule $erforms only syntactic analysis! %or this reasonB it may re$ort false $ositives by considerin* t.2'&TA/&S?ft(colB 9merry9@ or 2'&TA/&S ?ft(colB 9christmas9@ should be re.in* 1ueryF S-L-2T col %R'M dbo!tab =>-R.t $redicates ?CO/TA'/! or FR--T-2T@ o$eratin* on the same column in the same 1uery! As an e.ith a re*istered SQL Server instance! "oes not chec# databases that are not online! *arameters &one Additional 'nformation %ull5Te.This ruleF • • • 'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! Scans trace files associated .2'&TA/&S?ft(colB 9merry 'R christmas9@ The former 1uery $erforms t.o full5te.ritten asF S-L-2T col %R'M dbo!tab =>-R.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 .

$licit s$ecification of inde. ty$e! Synta.! This ruleF .ith e.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.M +&/Q+. for creatin* an inde.es is done .hen creatin* an inde. 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 .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@ .sF 2R-AT.(o$tion S M B!!!nN N M '& filegroup N R inde. is as follo. O "R'P(-G/ST/&) O STAT/ST/2S(&'R-2'MP+T.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.(o$tion S FF 7 P PA"(/&"-G O %/LL%A2T'R 6 fillfactor O /)&'R-("+P(0-.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.

hen strictly necessary! /n most cases default value ?0@ $rovides the best results! *arameters .ei*ht Poolin* is confi*ured in such a ./&"-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 .ei*ht $oolin* is a s$ecialized o$erationA it is recommended that it is used only .ay that fibers are turned on! /n most cases the lig0t+eig0t pooling confi*uration o$tion $rovides best $erformance .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.ith a re*istered SQL Server instance! "oes not chec# databases that are not online! *arameters &one Additional 'nformation 2R-AT.• • • 'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! Scans trace files associated .hen set to 0 ?default@! SQL Server li*ht.

t services! Processin* time for the full5te.ith full5te.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 .ei*ht Poolin* '$tion ?Administerin* SQL Server ?SQL Server@@ +sin* the li*ht.t enabled for one or more databases! *arameters &one Additional 'nformation 2onfi*urin* Server Tas#in* ?'$timizin* "atabase Performance ?SQL Server@@ %ull5Te.&one Additional 'nformation Li*ht.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.t Description This rule chec#s that the server is o$timized for bac#*round a$$lications to facilitate $erformance of full5te.ei*ht $oolin* '$tion Rule( Full-Text Background !ervices Optimi1ed Category %ull5Te.ith e1ual $riority! SQL ServerB .t Search Recommendations ?Troubleshootin* ?SQL Server@@ Rule( Full Text B#OB -xtension Type Category %ull5Te.ith full5te.tension column be varc0ar or nvarc0ar to facilitate full5te.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 .t Description This rule chec#s that the BL'B e.t search service can be im$roved by settin* u$ the server to run fore*round and bac#*round a$$lications .tension column should not be of ty$e c0ar or nc0ar for tables .t search! The BL'B e.

• • • 'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! 'nly scans databases that are full5te.t Search s$(fullte.es ?2reatin* and Maintainin* "atabases ?SQL Server@@ %ull5Te.! A ma.t Search Recommendations ?Troubleshootin* ?SQL Server@@ Rule( Full Text Catalog *lacement Category %ull5Te.arns user that there are too many catalo*s! %or o$timal 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 $erformance it is recommended that the catalo* count be #e$t lo.t Description .t enabled! "oes not chec# databases that are not online! *arameters &one Additional 'nformation %ull5Te.t(column ?Transact5SQL Reference ?SQL Server@@ Rule( Full Text Catalog Count Category %ull5Te.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.imum of 2JT full5te.t /nde.t Description This rule chec#s if the server instance has more than 20 catalo*s and .

is relatively /<' intensive ?on a hi*h levelB it consists of readin* data from SQL ServerB and then .t enabled! 2han*e trac#in* $o$ulation maintains a record of the ro.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.! 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.n $hysical drive ?or drives@B if $ossible! )iven the $rocess of buildin* a %ull5Te.s that have been modified in a system tableB and $ro$a*ates the chan*es to the full5te.t /nde.in* Su$$ort ?SQL Server Architecture ?SQL Server@@ Maintainin* %ull5Te.t inde.This rule chec#s that full5te.t catalo*s should be created on their o.ritin* the inde.t .t 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 Description This rule chec#s that chan*e trac#in* is enabled for all tables that have full5te.t Search Rule( Full-Text C0ange Tracking -nabled Category %ull5Te.t /nde.t catalo*s are not $laced on the same drive as the data! As a best $ractice %ull5Te.es ?2reatin* and Maintainin* "atabases ?SQL Server@@ Rule( Full Text *roperty !tore !i1e Category %ull5Te.

hether inde.ith more than 0B000 $a*es ?default value@! As Microsoft SQL Server 2000 maintains inde.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.es can benefit .es .een 0 and 00 indicatin* the ma.es can become fra*mented! "e$endin* on .t Search "e$loyment Rule( 'ndex Fragmentation Category "atabase Administration Description This rule chec#s .! "efaultF 20! Additional 'nformation Microsoft SQL Server 2000 /nde.imum size of the $ro$erty store in cases .here files have e. "efra*mentation Best Practices "B22 S>'=2'&T/) Statement . must have to be included in the scan! "efaultF 0B000 $a*es! )ax FragmentationF a number bet.or#load characteristicsB this fra*mentation can adversely affect .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.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.or#load $erformance! "e$endin* on de$loyment environmentB defra*mentation of inde.es to reflect u$dates to their underlyin* tablesB these inde. fra*mentation is too hi*h ?over a s$ecified $ercenta*eB default is 20K@ for inde.imum acce$table fra*mentation $ercenta*e for an inde.

B it is recommended that the tar*et column_list be e.ty$e79+9@ named dbo!sys$ro$erties and dbo!sysfullte.ser Tables Category SQL Server 200J Readiness Description This rule chec#s that user tables ?.ist in s$ecified databases! SQL Server 200J has chan*ed the ."B22 /&"-G"-%RA) Statement Rule( '/!-RT Column #ist Category T5SQL Description This rule chec#s ob3ects for use of /&S-RT statements .$licit s$ecification of tar*et column list! =hen insertin* into a table or vie.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 .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 .$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 .ty$e79S9@ of the same name .ill be aborted! System tables ?.tnotify do not e.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 .ithout e.

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 .in* limitsF =hen lo* file is confi*ured for fi.th be set as a $ercenta*e or accordin* to the follo.th $olicy for lo* file is ade1uate! An ade1uate *ro.&one Additional 'nformation Rule( #og File ro+t0 Category "atabase Administration Description This rule chec#s to see .th $olicy .thB it should be set to *ro.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.ed *ro.hether *ro.

here settin* ma.t Description This rule chec#s that the MSSearch service is runnin* as Local System! This rule is a$$licable only for servers .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.hen A=.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.hen the server is started! Full-Text !earc0 is enabledF /f full5te.memory is enabled! SQL Server .t Search memory re1uirement! &oteF There may still be other cases .Memory ?Administerin* SQL Server ?SQL Server@@ -ffects of min and ma.is enabledF /nstances of SQL Server 2000 do not dynamically mana*e the size of the address s$ace .ill reserve and loc# almost all available memory ?or the value of max server memory if the o$tion has been set@ .t enabled for one or more databases! *arameters .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=. server memory may be re1uiredB such as .ith full5te. server memory ?SQL Server Architecture ?SQL Server@@ Rule( )!!earc0 !ervice Account Category %ull5Te.

bein* tar*et of "ML from .ecutions of bac#u$ .ithin a tri**er! H@ 2hec#s .ithout ma#in* a bac#u$ co$y of it and truncate the lo*! .ithin the last G number of days ?H0 days by default@! The &'(L') and TR+&2AT-('&L.its if it is not 0! 2@ Scans all /&ST-A" '% tri**ers and *enerates a list of 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.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.&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. clauses of BA20+P remove the inactive $art of the lo* .ith &'(L') .

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.ecution! -.BA20+P o$erations . is as follo.sF M %R'M P R table(source S Q M 9!!!n N N .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 ./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.statements! Synta.ecutin* o$erations that caused the tri**er to fire! /t is *eneral *ood desi*n to have &'2'+&T set to '& .@ 6oins are s$ecified in the %R'M clause in "-L-T-B S-L-2TB and +P"AT.$ected results in a$$lication code e.ith &'(L')! "efaultF H0 "ays! Additional 'nformation Truncatin* the Transaction Lo* ?SQL Server Architecture ?SQL Server@@ Rule( /OCO.tra to#ens may cause une.

(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.does not return &+LL! /n some cases 88S-R4-R&AMbecomes &+LL and can cause $roblems! *arameters .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.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( /.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 .-R/A).## ::servername Category )eneral Administration Description This rule chec#s that ::!-R.B for e.

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 .sB functions and tri**ers to fla* use of e1uality and ine1uality com$arisons involvin* a &+LL constant! These com$arisons are undefined .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 .?Transact5SQL Reference ?SQL Server@@ Rule( /.&one Additional 'nformation 88S-R4-R&AM.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.hen A&S/(&+LLS o$tion is set to '&! /t is recommended to set A&S/(&+LLS to '& and use the /S #ey.ed .## Comparisons Category TSQL Description This rule scans stored $roceduresB vie.ect *refixes Category )eneric Description This rule chec#s that all ob3ects of ty$e X are $refi.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.

am$leF -nter TB#3 if all table names should have $refi.constraint . 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! . TBL(! Additional 'nformation &one Rule( Ob. constraint F/ 7 Scalar function 'F 7 /nlined table5function # 7 Lo* * 7 Stored $rocedure *< 7 PR/MAR. constraint R 7 Rule RF 7 Re$lication filter stored $rocedure ! 7 System table TF 7 Table function TR 7 Tri**er . for every ob3ect name of s$ecified ty$e! -.am$leF -nter .ed . 7 4ie. to scan for user tables • Recommended *refix for Ob.in* ob3ect ty$esF C 7 2>-20 constraint D 7 "efault or "-%A+LT constraint F 7 %'R-/)& 0-.• • '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. 2 7 -.ect 4mandatory5 F A strin* that should be a $refi." 7 +&/Q+.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. 0-.tended stored $rocedure! -.ect Type to !can 4mandatory5F A strin* re$resentin* an ob3ect ty$e to scan! +se any one of the follo. 7 +ser table .ect !uffixes Category )eneric Description This rule chec#s that all ob3ects of ty$e X are suffi.

tended stored $rocedure! -. constraint F/ 7 Scalar function 'F 7 /nlined table5function < 7 PR/MAR.constraint # 7 Lo* * 7 Stored $rocedure *< 7 PR/MAR.ill not su$$ort these "B22 commandsF • • • • • "B22 "B22 "B22 "B22 "B22 "BR-PA/R &-=ALL'2 P/&TABLR'=L'20 T-GTALL .am$leF -nter 3TB# if all table names should have suffi. 0-.constraint .am$leF -nter . for every ob3ect name of s$ecified ty$e! -. 2 7 -. constraint R 7 Rule RF 7 Re$lication filter stored $rocedure ! 7 System table TF 7 Table function TR 7 Tri**er . (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 . 7 +ser table . to scan for user tables • Recommended !uffix for Ob.ect Type to !can 4mandatory5F A strin* re$resentin* an ob3ect ty$e to scan! +se any one of the follo. or +&/Q+." 7 +&/Q+. 7 4ie. 0-.ect 4mandatory5 F A strin* that should be a suffi.• "oes not chec# databases that are not online! *arameters • Ob.in* ob3ect ty$esF C 7 2>-20 constraint D 7 "efault or "-%A+LT constraint F 7 %'R-/)& 0-.

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 . u$dates9 s$(confi*ure 9o$en ob3ects9 s$(confi*ure 9set .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 .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 .ill not su$$ort these s$(confi*ure commandsF • • • s$(confi*ure 9allo.• • "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 .

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 .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 .ill not su$$ort these system tablesF • • • sysloc#s sys$ro$erties sys.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 be su$$orted in SQL Server 200J under L0 com$atibility level! As an e. is not recommendedF S-L-2T au(id %R'M dbo!authors 'R"-R B.ith a symmetric multi$rocessor ?SMP@ confi*uration! *arameters &one Additional 'nformation $riority boost '$tion ?Administerin* SQL Server ?SQL Server@@ Rule( Recovery 'nterval . clause s$ecifyin* constants as sort columns! /nte*ers are not re$orted! Su$$ort for this synta.am$leB the follo. has been de$recated and .Category SQL Server 200J Readiness Description This rule chec#s stored $roceduresB functionsB vie.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 .in* synta. 9a9B null This ruleF • • • 'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! Scans trace files associated .s and tri**ers for use of 'R"-R B.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 .

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 .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 .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.arns if recovery mode is full or bul#5lo**ed and the transaction lo* has not been bac#ed u$ .

ith tri**ers do not necessarily e.ritten ?/&/T@! /f soB .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 .istin* media should be over.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! .$ect results to be returned as $art of the modification o$eration! %or this reason it is not recommended to return results from .hether the last three bac#u$ o$erations on a database have been $erformed to the same file s$ecifyin* that e.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.ithin a tri**erF • • • PR/&T statement S-L-2T ?.in* statements .ithin tri**ers! This rule fla*s as not recommended the use of the follo.s .ithout assi*nment or /&T' clause@ %-T2> ?.

am$leB if a stored $rocedure does some .ithin the same T5SQL frame! As an e. definitions may cause errors or chan*es in $erformance! As an e.am$leB the follo. is not recommendedF S-L-2T : %R'M dbo!authors .in* synta.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.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.• '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 .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.

/-L"S(&+LL Q+'T-"(/"-&T/%/-R The follo.in* set o$tionsF 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 .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(.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 .$licit list .henever the column to retrieve are #no.(2>-20S+M intrinsic function! &oteF BPA does not detect usa*e of 9:9 inside inline table5valued functionsA ho./t is recommended to have an e.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.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.

a$$in* out SQL Server $a*es thou*h they could be used by another $rocess .or#in* set size '$tion ?Administerin* SQL Server ?SQL Server@@ Server Memory '$tions ?Administerin* SQL Server ?SQL Server@@ Rule( !-T.ill vary dynamically bet.ithin a stored $rocedure since such a command is i*nored by SQL Server .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 .• • • • 'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! Scans trace files associated .een min server memory and max server memory! Settin* set +orking set si1e $revents the o$eratin* system from s.!-R usage Category "e$recation Description .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 .hen e.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 .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.

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. 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 .$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.here the name of the e.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 .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 .am$leB the follo.in* synta.s and tri**ers for use of column aliasin* .ith a re*istered SQL Server instance! "oes not chec# databases that are not online! *arameters .This rule chec#s stored $roceduresB functionsB vie.

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 .ayB .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 .ill not be able to u$*rade to SQL Server 200J .ith a +ni1ue 2onstraint defined! Tables that donXt have a Primary 0ey defined or a column .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.ith 9sys9 schema defined in them .&one Additional 'nformation Rule( ?!ys? .$ose metadata information in a consistent .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.istin* databases .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 .ly reserved 9sys9 schema! As suchB e.

/&"-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.here a tem$orary table is createdB no 2R-AT. 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.Additional 'nformation PR/MAR. 2onstraints ?2reatin* and Maintainin* "atabases ?SQL Server@@ Rule( Temp Table .ill re$ort $rocedures .er recom$ilations! &ote that if lar*e data volumes . 2onstraints ?2reatin* and Maintainin* "atabases ?SQL Server@@ 2reatin* and Modifyin* PR/MAR. at runtime every time the server is restarted! .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. 0-.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 be inserted in the tem$orary table it may still be $referred to use tem$orary tables due to $arallel e. 0-.

for incremental $o$ulation! /ncremental $o$ulation only ad3usts inde.ed table have a column of the timestam$ data ty$e! Re1uests for incremental $o$ulations on tables .ed table should have a timestam$ column to allo.here the T'P clause is s$ecified . entries for ro. clause! This rule .t inde.ill re$ort use of 1ueries .ill be $lan de$endent and may lead to undesired behavior! .iseB the results $roduced .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.t Description This rule chec#s that each full5te. clause in the 1uery! /t is *enerally recommended to s$ecify sort criteria .*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.ithout an 'R"-R B.s and tri**ers for usa*es of T'P in 1ueries .ithout an 'R"-R B.hen usin* T'P clause! 'ther.t /nde.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.s addedB deletedB or modified after the last $o$ulation! This feature re1uires that the inde.

ithin the last G number of days ?H0 days by default@! A $ossible une.$ected shutdo.se of !c0ema "ualified TablesA.This ruleF • • • 'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! Scans trace files associated .n is re$orted if a server startB indicated by the follo.n! *arameters • /umber of DaysF an inte*er value re$resentin* the number of days to scan for une.ns that mi*ht have occurred .ie+s Category T5SQL Description .nexpected !0utdo+ns Category )eneral Administration Description This rule chec#s the &T -vent Lo* and fla*s any une.$ected shutdo.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( .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.$ected shutdo.ns! "efaultF H0 "ays! Additional 'nformation Rule( .

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.se of sp3dboption Category "e$recation Description .everB it is recommended that schema name be s$ecified to identify a table or vie.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 .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 . or tri**er! =hen SQL Server loo#s u$ a table<vie. of 2R-AT.This rule chec#s stored $roceduresB functionsB vie.s! +nless s$ecified other.s and tri**ers for use of schema 1ualified names . inside a stored $rocedureB functionB vie.ner ?schema@ for SQL Server to identify the ob3ect! >o.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. 2onventions ?Transact5SQL Reference ?SQL Server@@ Rule( . .hen referencin* tables and vie.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.

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( .in* $refi.ects in )aster .ser Ob.ect /aming Category "atabase "esi*n Description This rule chec#s for user ob3ects .esF sp3B xp3B or fn3! Thou*h this $ractice is su$$ortedB it is recommended that the $refi.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 .s and tri**ers for use of s$(dbo$tion $rocedure! This stored $rocedure has been de$recated in favor of ALT-R "ATABAS.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( . should not be used for user defined stored $rocedures xp3F this $refi.tended stored $rocedures fn3F this $refi.ith Microsoft shi$$ed ob3ectsF • • • sp3F this $refi.es not be used to avoid name clashes .ith any of the follo.statement and .This rule chec#s stored $roceduresB functionsB vie.ser Ob. should not be used for user defined e.

tended stored $rocedures or startu$ $roceduresB *iven that master is the only database . do.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.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 .here they can be created! *arameters &one Additional 'nformation Rule( .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.

ord is s$ecified! As an e.Category SQL Server 200J Readiness Description This rule chec#s stored $roceduresB tri**ersB vie.ithout the 7'TB #ey.ord! /t is recommended that hints be s$ecified usin* the 7'TB #ey.ord! This ruleF • • • 'nly scans databases s$ecified in the "atabase List of a re*istered SQL Server instance! Scans trace files associated .s and functions for use of table hints .ill .ill not su$$ort the use of more than one hints in a T5SQL statement unless the 7'TB #ey.ord! SQL Server 200J .or# in SQL Server 200JB thou*h it is still recommended to use the =/T> #ey. 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 .am$leB the follo.in* synta.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! .