You are on page 1of 16

5CL-5erver Interv|ew Cuest|ons 1

What |s kD8M5?
8elaLlonal uaLa 8ase ManaaemenL SvsLems (8u8MS) are daLabase manaaemenL
svsLems LhaL malnLaln daLa records and lndlces ln Lables. 8elaLlonshlps mav be
creaLed and malnLalned across and amona Lhe daLa and Lables. ln a relaLlonal
daLabase, relaLlonshlps beLween daLa lLems are expressed bv means of Lables.
lnLerdependencles amona Lhese Lables are expressed bv daLa values raLher Lhan bv
polnLers. 1hls allows a hlah dearee of daLa lndependence. An 8u8MS has Lhe
capablllLv Lo recomblne Lhe daLa lLems from dlfferenL flles, provldlna powerful Lools
for daLa usaae.

What |s norma||zat|on?
uaLabase normallzaLlon ls a daLa deslan and oraanlzaLlon process applled Lo daLa
sLrucLures based on rules LhaL help bulld relaLlonal daLabases. ln relaLlonal daLabase
deslan, Lhe process of oraanlzlna daLa Lo mlnlmlze redundancv. normallzaLlon usuallv
lnvolves dlvldlna a daLabase lnLo Lwo or more Lables and deflnlna relaLlonshlps
beLween Lhe Lables. 1he ob[ecLlve ls Lo lsolaLe daLa so LhaL addlLlons, deleLlons, and
modlflcaLlons of a fleld can be made ln [usL one Lable and Lhen propaaaLed Lhrouah
Lhe resL of Lhe daLabase vla Lhe deflned relaLlonshlps.

What are d|fferent norma||zat|on forms?
1Nl: /iminote kepeotino 6roups
Make a separaLe Lable for each seL of relaLed aLLrlbuLes, and alve each Lable a
prlmarv kev. Lach fleld conLalns aL mosL one value from lLs aLLrlbuLe domaln.
2Nl: /iminote kedundont uoto
lf an aLLrlbuLe depends on onlv parL of a mulLl-valued kev, remove lL Lo a separaLe
Lable.
lNl: /iminote co/umns Not uependent On key
lf aLLrlbuLes do noL conLrlbuLe Lo a descrlpLlon of Lhe kev, remove Lhem Lo a separaLe
Lable. All aLLrlbuLes musL be dlrecLlv dependenL on Lhe prlmarv kev
8cNl: 8oyce-codd Normo/ lorm
lf Lhere are non-Lrlvlal dependencles beLween candldaLe kev aLLrlbuLes, separaLe
Lhem ouL lnLo dlsLlncL Lables.
4Nl: lso/ote lndependent Mu/tip/e ke/otionships
no Lable mav conLaln Lwo or more 1:n or n:m relaLlonshlps LhaL are noL dlrecLlv
relaLed.
5Nl: lso/ote 5emontico//y ke/oted Mu/tip/e ke/otionships
1here mav be pracLlcal consLralns on lnformaLlon LhaL [usLlfv separaLlna loalcallv
relaLed manv-Lo-manv relaLlonshlps.
ONl: Optimo/ Normo/ lorm
A model llmlLed Lo onlv slmple (elemenLal) facLs, as expressed ln Cb[ecL 8ole Model
noLaLlon.
ukNl: uomoin-key Normo/ lorm
A model free from all modlflcaLlon anomalles.
8emember, Lhese normallzaLlon auldellnes are cumulaLlve. lor a daLabase Lo be ln
3nl, lL musL flrsL fulflll all Lhe crlLerla of a 2nl and 1nl daLabase.

What |s 5tored rocedure?
A sLored procedure ls a named aroup of SCL sLaLemenLs LhaL have been prevlouslv
creaLed and sLored ln Lhe server daLabase. SLored procedures accepL lnpuL
parameLers so LhaL a slnale procedure can be used over Lhe neLwork bv several
cllenLs uslna dlfferenL lnpuL daLa. And when Lhe procedure ls modlfled, all cllenLs
auLomaLlcallv aeL Lhe new verslon. SLored procedures reduce neLwork Lrafflc and
lmprove performance. SLored procedures can be used Lo help ensure Lhe lnLearlLv of
Lhe daLabase.
e.a. sp_helpdb, sp_renamedb, sp_depends eLc.

What |s 1r|gger?
A Lrlaaer ls a SCL procedure LhaL lnlLlaLes an acLlon when an evenL (lnSL81, uLLL1L
or uuA1L) occurs. 1rlaaers are sLored ln and manaaed bv Lhe u8MS.1rlaaers are
used Lo malnLaln Lhe referenLlal lnLearlLv of daLa bv chanalna Lhe daLa ln a svsLemaLlc
fashlon. A Lrlaaer cannoL be called or execuLed, Lhe u8MS auLomaLlcallv flres Lhe
Lrlaaer as a resulL of a daLa modlflcaLlon Lo Lhe assoclaLed Lable. 1rlaaers can be
vlewed as slmllar Lo sLored procedures ln LhaL boLh conslsL of procedural loalc LhaL ls
sLored aL Lhe daLabase level. SLored procedures, however, are noL evenL-drlve and
are noL aLLached Lo a speclflc Lable as Lrlaaers are. SLored procedures are expllclLlv
execuLed bv lnvoklna a CALL Lo Lhe procedure whlle Lrlaaers are lmpllclLlv execuLed.
ln addlLlon, Lrlaaers can also execuLe sLored procedures.
Nested 1riooer: A Lrlaaer can also conLaln lnSL81, uuA1L and uLLL1L loalc wlLhln
lLself, so when Lhe Lrlaaer ls flred because of daLa modlflcaLlon lL can also cause
anoLher daLa modlflcaLlon, Lherebv flrlna anoLher Lrlaaer. A Lrlaaer LhaL conLalns daLa
modlflcaLlon loalc wlLhln lLself ls called a nesLed Lrlaaer.

What |s V|ew?
A slmple vlew can be LhouahL of as a subseL of a Lable. lL can be used for reLrlevlna
daLa, as well as updaLlna or deleLlna rows. 8ows updaLed or deleLed ln Lhe vlew are
updaLed or deleLed ln Lhe Lable Lhe vlew was creaLed wlLh. lL should also be noLed
LhaL as daLa ln Lhe orlalnal Lable chanaes, so does daLa ln Lhe vlew, as vlews are Lhe
wav Lo look aL parL of Lhe orlalnal Lable. 1he resulLs of uslna a vlew are noL
permanenLlv sLored ln Lhe daLabase. 1he daLa accessed Lhrouah a vlew ls acLuallv
consLrucLed uslna sLandard 1-SCL selecL command and can come from one Lo manv
dlfferenL base Lables or even oLher vlews.

What |s Index?
An lndex ls a phvslcal sLrucLure conLalnlna polnLers Lo Lhe daLa. lndlces are creaLed ln
an exlsLlna Lable Lo locaLe rows more qulcklv and efflclenLlv. lL ls posslble Lo creaLe an
lndex on one or more columns of a Lable, and each lndex ls alven a name. 1he users
cannoL see Lhe lndexes, Lhev are [usL used Lo speed up querles. LffecLlve lndexes are
one of Lhe besL wavs Lo lmprove performance ln a daLabase appllcaLlon. A Lable scan
happens when Lhere ls no lndex avallable Lo help a querv. ln a Lable scan SCL Server
examlnes everv row ln Lhe Lable Lo saLlsfv Lhe querv resulLs. 1able scans are
someLlmes unavoldable, buL on larae Lables, scans have a Lerrlflc lmpacL on
performance.
closteteJ loJexes deflne Lhe phvslcal sorLlna of a daLabase Lable's rows ln Lhe sLoraae
medla. lor Lhls reason, each daLabase Lable mav have onlv one clusLered lndex.
Noo-closteteJ loJexes are creaLed ouLslde of Lhe daLabase Lable and conLaln a sorLed
llsL of references Lo Lhe Lable lLself.

What |s the d|fference between c|ustered and a non-c|ustered |ndex?
A closteteJ loJex ls a speclal Lvpe of lndex LhaL reorders Lhe wav records ln Lhe Lable
are phvslcallv sLored. 1herefore Lable can have onlv one clusLered lndex. 1he leaf
nodes of a clusLered lndex conLaln Lhe daLa paaes.
A oooclosteteJ loJex ls a speclal Lvpe of lndex ln whlch Lhe loalcal order of Lhe lndex
does noL maLch Lhe phvslcal sLored order of Lhe rows on dlsk. 1he leaf node of a
nonclusLered lndex does noL conslsL of Lhe daLa paaes. lnsLead, Lhe leaf nodes
conLaln lndex rows.

What are the d|fferent |ndex conf|gurat|ons a tab|e can have?
A Lable can have one of Lhe followlna lndex conflauraLlons:
no lndexes
A clusLered lndex
A clusLered lndex and manv nonclusLered lndexes
A nonclusLered lndex
Manv nonclusLered lndexes

What |s cursors?
Cursor ls a daLabase ob[ecL used bv appllcaLlons Lo manlpulaLe daLa ln a seL on a row-
bv-row basls, lnsLead of Lhe Lvplcal SCL commands LhaL operaLe on all Lhe rows ln Lhe
seL aL one Llme.
ln order Lo work wlLh a cursor we need Lo perform some sLeps ln Lhe followlna order:
ueclare cursor
Cpen cursor
leLch row from Lhe cursor
rocess feLched row
Close cursor
ueallocaLe cursor

What |s the use of D8CC commands?
u8CC sLands for daLabase conslsLencv checker. We use Lhese commands Lo check Lhe
conslsLencv of Lhe daLabases, l.e., malnLenance, valldaLlon Lask and sLaLus checks.
L.a. u8CC CPLCku8 - Lnsures LhaL Lables ln Lhe db and Lhe lndexes are correcLlv
llnked.
u8CC CPLCkALLCC - 1o check LhaL all paaes ln a db are correcLlv allocaLed.
u8CC CPLCkllLLC8Cu - Checks all Lables flle aroup for anv damaae.

What |s a L|nked 5erver?
Llnked Servers ls a concepL ln SCL Server bv whlch we can add oLher SCL Server Lo a
Croup and querv boLh Lhe SCL Server dbs uslna 1-SCL SLaLemenLs. WlLh a llnked
server, vou can creaLe verv clean, easv Lo follow, SCL sLaLemenLs LhaL allow remoLe
daLa Lo be reLrleved, [olned and comblned wlLh local daLa.
SLorped rocedure sp_addllnkedserver, sp_addllnkedsrvloaln wlll be used add new
Llnked Server.

What |s Co||at|on?
CollaLlon refers Lo a seL of rules LhaL deLermlne how daLa ls sorLed and compared.
CharacLer daLa ls sorLed uslna rules LhaL deflne Lhe correcL characLer sequence, wlLh
opLlons for speclfvlna case-senslLlvlLv, accenL marks, kana characLer Lvpes and
characLer wldLh.

What are d|fferent type of Co||at|on 5ens|t|v|ty?
cose sensitivity
A and a, 8 and b, eLc.
Acceot seosltlvltv
a and , o and , eLc.
kono 5ensitivity
When !apanese kana characLers Plraaana and kaLakana are LreaLed dlfferenLlv, lL ls
called kana senslLlve.
width sensitivity
When a slnale-bvLe characLer (half-wldLh) and Lhe same characLer when represenLed
as a double-bvLe characLer (full-wldLh) are LreaLed dlfferenLlv Lhen lL ls wldLh
senslLlve.

What's the d|fference between a pr|mary key and a un|que key?
8oLh prlmarv kev and unlque enforce unlqueness of Lhe column on whlch Lhev are
deflned. 8uL bv defaulL prlmarv kev creaLes a clusLered lndex on Lhe column, where
are unlque creaLes a nonclusLered lndex bv defaulL. AnoLher ma[or dlfference ls LhaL,
prlmarv kev doesn'L allow nuLLs, buL unlque kev allows one nuLL onlv.

now to |mp|ement one-to-one, one-to-many and many-to-many re|at|onsh|ps
wh||e des|gn|ng tab|es?
Cne-Lo-Cne relaLlonshlp can be lmplemenLed as a slnale Lable and rarelv as Lwo
Lables wlLh prlmarv and forelan kev relaLlonshlps.
Cne-Lo-Manv relaLlonshlps are lmplemenLed bv spllLLlna Lhe daLa lnLo Lwo Lables
wlLh prlmarv kev and forelan kev relaLlonshlps.
5CL-5erver Interv|ew Cuest|ons 2

Manv-Lo-Manv relaLlonshlps are lmplemenLed uslna a [uncLlon Lable wlLh Lhe kevs
from boLh Lhe Lables formlna Lhe composlLe prlmarv kev of Lhe [uncLlon Lable.

What |s a NCLCCk?
uslna Lhe nCLCCk querv opLlmlser hlnL ls aenerallv consldered aood pracLlce ln order
Lo lmprove concurrencv on a busv svsLem. When Lhe nCLCCk hlnL ls lncluded ln a
SLLLC1 sLaLemenL, no locks are Laken when daLa ls read. 1he resulL ls a ulrLv 8ead,
whlch means LhaL anoLher process could be updaLlna Lhe daLa aL Lhe exacL Llme vou
are readlna lL. 1here are no auaranLees LhaL vour querv wlll reLrleve Lhe mosL recenL
daLa. 1he advanLaae Lo performance ls LhaL vour readlna of daLa wlll noL block
updaLes from Laklna place, and updaLes wlll noL block vour readlna of daLa. SLLLC1
sLaLemenLs Lake Shared (8ead) locks. 1hls means LhaL mulLlple SLLLC1 sLaLemenLs are
allowed slmulLaneous access, buL oLher processes are blocked from modlfvlna Lhe
daLa. 1he updaLes wlll queue unLll all Lhe reads have compleLed, and reads requesLed
afLer Lhe updaLe wlll walL for Lhe updaLes Lo compleLe. 1he resulL Lo vour svsLem ls
delav(blocklna).

What |s d|fference between DLLL1L & 1kUNCA1L commands?
ueleLe command removes Lhe rows from a Lable based on Lhe condlLlon LhaL we
provlde wlLh a WPL8L clause. 1runcaLe wlll acLuallv remove all Lhe rows from a Lable
and Lhere wlll be no daLa ln Lhe Lable afLer we run Lhe LruncaLe command.
1kuNc41
18unCA1L ls fasLer and uses fewer svsLem and LransacLlon loa resources Lhan
uLLL1L.
18unCA1L removes Lhe daLa bv deallocaLlna Lhe daLa paaes used Lo sLore Lhe Lable's
daLa, and onlv Lhe paae deallocaLlons are recorded ln Lhe LransacLlon loa.
18unCA1L removes all rows from a Lable, buL Lhe Lable sLrucLure and lLs columns,
consLralnLs, lndexes and so on remaln. 1he counLer used bv an ldenLlLv for new rows
ls reseL Lo Lhe seed for Lhe column.
?ou cannoL use 18unCA1L 1A8LL on a Lable referenced bv a lC8LlCn kL? consLralnL.
8ecause 18unCA1L 1A8LL ls noL loaaed, lL cannoL acLlvaLe a Lrlaaer.
18unCA1L can noL be 8olled back uslna loas.
18unCA1L ls uuL Command.
18unCA1L 8eseLs ldenLlLv of Lhe Lable.
uL1
uLLL1L removes rows one aL a Llme and records an enLrv ln Lhe LransacLlon loa for
each deleLed row.
lf vou wanL Lo reLaln Lhe ldenLlLv counLer, use uLLL1L lnsLead. lf vou wanL Lo remove
Lable deflnlLlon and lLs daLa, use Lhe u8C 1A8LL sLaLemenL.
uLLL1L Can be used wlLh or wlLhouL a WPL8L clause
uLLL1L AcLlvaLes 1rlaaers.
uLLL1L Can be 8olled back uslna loas.
uLLL1L ls uML Command.
uLLL1L does noL reseL ldenLlLv of Lhe Lable.

D|fference between Iunct|on and 5tored rocedure?
uul can be used ln Lhe SCL sLaLemenLs anvwhere ln Lhe WPL8L/PAvlnC/SLLLC1
secLlon where as SLored procedures cannoL be.
uuls LhaL reLurn Lables can be LreaLed as anoLher rowseL. 1hls can be used ln !Clns
wlLh oLher Lables.
lnllne uul's can be Lhouah of as vlews LhaL Lake parameLers and can be used ln !Clns
and oLher 8owseL operaLlons.

When |s the use of UDA1L_51A1I51IC5 command?
1hls command ls baslcallv used when a larae processlna of daLa has occurred. lf a
larae amounL of deleLlons anv modlflcaLlon or 8ulk Copv lnLo Lhe Lables has occurred,
lL has Lo updaLe Lhe lndexes Lo Lake Lhese chanaes lnLo accounL. uuA1L_S1A1lS1lCS
updaLes Lhe lndexes on Lhese Lables accordlnalv.

What types of Io|ns are poss|b|e w|th 5q| 5erver?
!olns are used ln querles Lo explaln how dlfferenL Lables are relaLed. !olns also leL vou
selecL daLa from a Lable dependlna upon daLa from anoLher Lable.
1vpes of [olns: lnnL8 !Clns, Cu1L8 !Clns, C8CSS !Clns. Cu1L8 !Clns are furLher
classlfled as LLl1 Cu1L8 !ClnS, 8lCP1 Cu1L8 !ClnS and luLL Cu1L8 !ClnS.

What |s the d|fference between a nAVING CLAU5L and a WnLkL CLAU5L?
Speclfles a search condlLlon for a aroup or an aaareaaLe. PAvlnC can be used onlv
wlLh Lhe SLLLC1 sLaLemenL. PAvlnC ls Lvplcallv used ln a C8Cu 8? clause. When
C8Cu 8? ls noL used, PAvlnC behaves llke a WPL8L clause. Pavlna Clause ls
baslcallv used onlv wlLh Lhe C8Cu 8? funcLlon ln a querv. WPL8L Clause ls applled
Lo each row before Lhev are parL of Lhe C8Cu 8? funcLlon ln a querv. PAvlnC
crlLerla ls applled afLer Lhe Lhe arouplna of rows has occurred.

What |s sub-query? Lxp|a|n propert|es of sub-query.
Sub-querles are ofLen referred Lo as sub-selecLs, as Lhev allow a SLLLC1 sLaLemenL Lo
be execuLed arblLrarllv wlLhln Lhe bodv of anoLher SCL sLaLemenL. A sub-querv ls
execuLed bv encloslna lL ln a seL of parenLheses. Sub-querles are aenerallv used Lo
reLurn a slnale row as an aLomlc value, Lhouah Lhev mav be used Lo compare values
aaalnsL mulLlple rows wlLh Lhe ln kevword.
A subquerv ls a SLLLC1 sLaLemenL LhaL ls nesLed wlLhln anoLher 1-SCL sLaLemenL. A
subquerv SLLLC1 sLaLemenL lf execuLed lndependenLlv of Lhe 1-SCL sLaLemenL, ln
whlch lL ls nesLed, wlll reLurn a resulL seL. Meanlna a subquerv SLLLC1 sLaLemenL can
sLandalone and ls noL depended on Lhe sLaLemenL ln whlch lL ls nesLed. A subquerv
SLLLC1 sLaLemenL can reLurn anv number of values, and can be found ln, Lhe column
llsL of a SLLLC1 sLaLemenL, a l8CM, C8Cu 8?, PAvlnC, and/or C8uL8 8? clauses of
a 1-SCL sLaLemenL. A Subquerv can also be used as a parameLer Lo a funcLlon call.
8aslcallv a subquerv can be used anvwhere an expresslon can be used.
Properties of 5ub-Ouery
A subquerv musL be enclosed ln Lhe parenLhesls.
A subquerv musL be puL ln Lhe rlahL hand of Lhe comparlson operaLor, and
A subquerv cannoL conLaln a C8uL8-8? clause.
A querv can conLaln more Lhan one sub-querles.

What are types of sub-quer|es?
Slnale-row subquerv, where Lhe subquerv reLurns onlv one row.
MulLlple-row subquerv, where Lhe subquerv reLurns mulLlple rows,.and
MulLlple column subquerv, where Lhe subquerv reLurns mulLlple columns.

What |s 5CL rof||er?
SCL rofller ls a araphlcal Lool LhaL allows svsLem admlnlsLraLors Lo monlLor evenLs ln
an lnsLance of MlcrosofL SCL Server. ?ou can capLure and save daLa abouL each evenL
Lo a flle or SCL Server Lable Lo analvze laLer. lor example, vou can monlLor a
producLlon envlronmenL Lo see whlch sLored procedures are hamperlna performance
bv execuLlna Loo slowlv.
use SCL rofller Lo monlLor onlv Lhe evenLs ln whlch vou are lnLeresLed. lf Lraces are
becomlna Loo larae, vou can fllLer Lhem based on Lhe lnformaLlon vou wanL, so LhaL
onlv a subseL of Lhe evenL daLa ls collecLed. MonlLorlna Loo manv evenLs adds
overhead Lo Lhe server and Lhe monlLorlna process and can cause Lhe Lrace flle or
Lrace Lable Lo arow verv larae, especlallv when Lhe monlLorlna process Lakes place
over a lona perlod of Llme.

What |s User Def|ned Iunct|ons?
user-ueflned luncLlons allow Lo deflne lLs own 1-SCL funcLlons LhaL can accepL 0 or
more parameLers and reLurn a slnale scalar daLa value or a Lable daLa Lvpe.

What k|nd of User-Def|ned Iunct|ons can be created?
1here are Lhree Lvpes of user-ueflned funcLlons ln SCL Server 2000 and Lhev are
Scalar, lnllne 1able-valued and MulLl-sLaLemenL 1able-valued.
5co/or user-uefined lunction
A Scalar user-deflned funcLlon reLurns one of Lhe scalar daLa Lvpes. 1exL, nLexL, lmaae
and LlmesLamp daLa Lvpes are noL supporLed. 1hese are Lhe Lvpe of user-deflned
funcLlons LhaL mosL developers are used Lo ln oLher proarammlna lanauaaes. ?ou
pass ln 0 Lo manv parameLers and vou aeL a reLurn value.
ln/ine 1ob/e-vo/ue user-uefined lunction
An lnllne 1able-value user-deflned funcLlon reLurns a Lable daLa Lvpe and ls an
excepLlonal alLernaLlve Lo a vlew as Lhe user-deflned funcLlon can pass parameLers
lnLo a 1-SCL selecL command and ln essence provlde us wlLh a parameLerlzed, non-
updaLeable vlew of Lhe underlvlna Lables.
Mu/ti-stotement 1ob/e-vo/ue user-uefined lunction
A MulLl-SLaLemenL 1able-value user-deflned funcLlon reLurns a Lable and ls also an
excepLlonal alLernaLlve Lo a vlew as Lhe funcLlon can supporL mulLlple 1-SCL
sLaLemenLs Lo bulld Lhe flnal resulL where Lhe vlew ls llmlLed Lo a slnale SLLLC1
sLaLemenL. Also, Lhe ablllLv Lo pass parameLers lnLo a 1-SCL selecL command or a
aroup of Lhem alves us Lhe capablllLv Lo ln essence creaLe a parameLerlzed, non-
updaLeable vlew of Lhe daLa ln Lhe underlvlna Lables. WlLhln Lhe creaLe funcLlon
command vou musL deflne Lhe Lable sLrucLure LhaL ls belna reLurned. AfLer creaLlna
Lhls Lvpe of user-deflned funcLlon, lL can be used ln Lhe l8CM clause of a 1-SCL
command unllke Lhe behavlor found when uslna a sLored procedure whlch can also
reLurn record seLs.

Wh|ch 1C/I port does 5CL 5erver run on? now can |t be changed?
SCL Server runs on porL 1433. lL can be chanaed from Lhe neLwork uLlllLv 1C/l
properLles -> orL number.boLh on cllenL and Lhe server.

What are the authent|cat|on modes |n 5CL 5erver? now can |t be changed?
Wlndows mode and mlxed mode (SCL & Wlndows).
1o chanae auLhenLlcaLlon mode ln SCL Server cllck SLarL, roarams, MlcrosofL SCL
Server and cllck SCL LnLerprlse Manaaer Lo run SCL LnLerprlse Manaaer from Lhe
MlcrosofL SCL Server proaram aroup. SelecL Lhe server Lhen from Lhe 1ools menu
selecL SCL Server ConflauraLlon roperLles, and choose Lhe SecurlLv paae.

Where are 5CL server users names and passwords are stored |n sq| server?
1hev aeL sLored ln masLer db ln Lhe svsxloalns Lable.

Wh|ch command us|ng Cuery Ana|yzer w||| g|ve you the vers|on of 5CL server and
operat|ng system?
SLLLC1 SL8vL88CL81?('producLverslon'), SL8vL88CL81? ('producLlevel'),
SL8vL88CL81? ('edlLlon')

What |s 5CL server agent?
SCL Server aaenL plavs an lmporLanL role ln Lhe dav-Lo-dav Lasks of a daLabase
admlnlsLraLor (u8A). lL ls ofLen overlooked as one of Lhe maln Lools for SCL Server
manaaemenL. lLs purpose ls Lo ease Lhe lmplemenLaLlon of Lasks for Lhe u8A, wlLh lLs
full-funcLlon schedullna enalne, whlch allows vou Lo schedule vour own [obs and
scrlpLs.

Can a stored procedure ca|| |tse|f or recurs|ve stored procedure? now many |eve| 5
nest|ng poss|b|e?
?es. 8ecause 1ransacL-SCL supporLs recurslon, vou can wrlLe sLored procedures LhaL
call Lhemselves. 8ecurslon can be deflned as a meLhod of problem solvlna whereln
Lhe soluLlon ls arrlved aL bv repeLlLlvelv applvlna lL Lo subseLs of Lhe problem. A
common appllcaLlon of recurslve loalc ls Lo perform numerlc compuLaLlons LhaL lend
Lhemselves Lo repeLlLlve evaluaLlon bv Lhe same processlna sLeps. SLored procedures
are nesLed when one sLored procedure calls anoLher or execuLes manaaed code bv
5CL-5erver Interv|ew Cuest|ons 3

referenclna a CL8 rouLlne, Lvpe, or aaareaaLe. ?ou can nesL sLored procedures and
manaaed code references up Lo 32 levels.

What |s @@LkkCk?
1he L88C8 auLomaLlc varlable reLurns Lhe error code of Lhe lasL 1ransacL-SCL
sLaLemenL. lf Lhere was no error, L88C8 reLurns zero. 8ecause L88C8 ls
reseL afLer each 1ransacL-SCL sLaLemenL, lL musL be saved Lo a varlable lf lL ls needed
Lo process lL furLher afLer checklna lL.

What |s ka|seerror?
SLored procedures reporL errors Lo cllenL appllcaLlons vla Lhe 8AlSL88C8 command.
8AlSL88C8 doesn'L chanae Lhe flow of a procedure, lL merelv dlsplavs an error
messaae, seLs Lhe L88C8 auLomaLlc varlable, and opLlonallv wrlLes Lhe messaae
Lo Lhe SCL Server error loa and Lhe n1 appllcaLlon evenL loa.

What |s |og sh|pp|ng?
Loa shlpplna ls Lhe process of auLomaLlna Lhe backup of daLabase and LransacLlon loa
flles on a producLlon SCL server, and Lhen resLorlna Lhem onLo a sLandbv server.
LnLerprlse LdlLlons onlv supporLs loa shlpplna. ln loa shlpplna Lhe LransacLlonal loa
flle from one server ls auLomaLlcallv updaLed lnLo Lhe backup daLabase on Lhe oLher
server. lf one server falls, Lhe oLher server wlll have Lhe same db can be used Lhls as
Lhe ulsasLer 8ecoverv plan. 1he kev feaLure of loa shlpplna ls LhaL ls wlll auLomaLlcallv
backup LransacLlon loas LhrouahouL Lhe dav and auLomaLlcallv resLore Lhem on Lhe
sLandbv server aL deflned lnLerval.

What |s the d|fference between a |oca| and a g|oba| var|ab|e?
A locol tempototv Lable exlsLs onlv for Lhe duraLlon of a connecLlon or, lf deflned
lnslde a compound sLaLemenL, for Lhe duraLlon of Lhe compound sLaLemenL.
A olobol tempototv Lable remalns ln Lhe daLabase permanenLlv, buL Lhe rows exlsL
onlv wlLhln a alven connecLlon. When connecLlon are closed, Lhe daLa ln Lhe alobal
Lemporarv Lable dlsappears. Powever, Lhe Lable deflnlLlon remalns wlLh Lhe daLabase
for access when daLabase ls opened nexL Llme.

What command do we use to rename a db?
sp_renamedb 'oldname' , 'newname'
lf someone ls uslna db lL wlll noL accepL sp_renmaedb. ln LhaL case flrsL brlna db Lo
slnale user uslna sp_dbopLlons. use sp_renamedb Lo rename daLabase. use
sp_dbopLlons Lo brlna daLabase Lo mulLl user mode.

What |s sp_conf|gure commands and set commands?
use sp_conflaure Lo dlsplav or chanae server-level seLLlnas. 1o chanae daLabase-level
seLLlnas, use AL1L8 uA1A8ASL. 1o chanae seLLlnas LhaL affecL onlv Lhe currenL user
sesslon, use Lhe SL1 sLaLemenL.

What are the d|fferent types of rep||cat|on? Lxp|a|n.
1he SCL Server 2000-supporLed repllcaLlon Lvpes are as follows:
1ransacLlonal
SnapshoL
Merae
5nopshot rep/icotion dlsLrlbuLes daLa exacLlv as lL appears aL a speclflc momenL ln
Llme and does noL monlLor for updaLes Lo Lhe daLa. SnapshoL repllcaLlon ls besL used
as a meLhod for repllcaLlna daLa LhaL chanaes lnfrequenLlv or where Lhe mosL up-Lo-
daLe values (low laLencv) are noL a requlremenL. When svnchronlzaLlon occurs, Lhe
enLlre snapshoL ls aeneraLed and senL Lo Subscrlbers.
1ronsoctiono/ rep/icotion, an lnlLlal snapshoL of daLa ls applled aL Subscrlbers, and
Lhen when daLa modlflcaLlons are made aL Lhe ubllsher, Lhe lndlvldual LransacLlons
are capLured and propaaaLed Lo Subscrlbers.
Meroe rep/icotion ls Lhe process of dlsLrlbuLlna daLa from ubllsher Lo Subscrlbers,
allowlna Lhe ubllsher and Subscrlbers Lo make updaLes whlle connecLed or
dlsconnecLed, and Lhen meralna Lhe updaLes beLween slLes when Lhev are
connecLed.

What are the C5 serv|ces that the 5CL 5erver |nsta||at|on adds?
MS SCL SL8vL8 SL8vlCL, SCL ACLn1 SL8vlCL, u1C (ulsLrlbuLlon Lransac co-
ordlnaLor)

What are three 5CL keywords used to change or set someone's perm|ss|ons?
C8An1, uLn?, and 8LvCkL.

What does |t mean to have quoted_|dent|f|er on? What are the |mp||cat|ons of
hav|ng |t off?
When SL1 CuC1Lu_luLn1lllL8 ls Cn, ldenLlflers can be dellmlLed bv double
quoLaLlon marks, and llLerals musL be dellmlLed bv slnale quoLaLlon marks. When SL1
CuC1Lu_luLn1lllL8 ls Cll, ldenLlflers cannoL be quoLed and musL follow all
1ransacL-SCL rules for ldenLlflers.

What |s the 51UII funct|on and how does |t d|ffer from the kLLACL funct|on?
S1ull funcLlon Lo overwrlLe exlsLlna characLers. uslna Lhls svnLax,
S1ull(sLrlna_expresslon, sLarL, lenaLh, replacemenL_characLers), sLrlna_expresslon ls
Lhe sLrlna LhaL wlll have characLers subsLlLuLed, sLarL ls Lhe sLarLlna poslLlon, lenaLh ls
Lhe number of characLers ln Lhe sLrlna LhaL are subsLlLuLed, and
replacemenL_characLers are Lhe new characLers lnLer[ecLed lnLo Lhe sLrlna.
8LLACL funcLlon Lo replace exlsLlna characLers of all occurance. uslna Lhls svnLax
8LLACL(sLrlna_expresslon, search_sLrlna, replacemenL_sLrlna), where everv
lncldence of search_sLrlna found ln Lhe sLrlna_expresslon wlll be replaced wlLh
replacemenL_sLrlna.

Us|ng query ana|yzer, name 3 ways to get an accurate count of the number of
records |n a tab|e?
SLLLC1 * l8CM Lable1
SLLLC1 CCun1(*) l8CM Lable1
SLLLC1 rows l8CM svslndexes WPL8L ld = C8!LC1_lu(Lable1) Anu lndld < 2

now to rebu||d Master Database?
ShuLdown MlcrosofL SCL Server 2000, and Lhen run 8ebulldm.exe. 1hls ls locaLed ln
Lhe roaram llles\MlcrosofL SCL Server\80\1ools\8lnn dlrecLorv.
ln Lhe 8ebulld MasLer dlaloa box, cllck 8rowse.
ln Lhe 8rowse for lolder dlaloa box, selecL Lhe \uaLa folder on Lhe SCL Server 2000
compacL dlsc or ln Lhe shared neLwork dlrecLorv from whlch SCL Server 2000 was
lnsLalled, and Lhen cllck Ck.
Cllck SeLLlnas. ln Lhe CollaLlon SeLLlnas dlaloa box, verlfv or chanae seLLlnas used for
Lhe masLer daLabase and all oLher daLabases.
lnlLlallv, Lhe defaulL collaLlon seLLlnas are shown, buL Lhese mav noL maLch Lhe
collaLlon selecLed durlna seLup. ?ou can selecL Lhe same seLLlnas used durlna seLup or
selecL new collaLlon seLLlnas. When done, cllck Ck.
ln Lhe 8ebulld MasLer dlaloa box, cllck 8ebulld Lo sLarL Lhe process.
1he 8ebulld MasLer uLlllLv relnsLalls Lhe masLer daLabase.
1o conLlnue, vou mav need Lo sLop a server LhaL ls runnlna.
Source: hLLp://msdn2.mlcrosofL.com/en-us/llbrarv/aa197930(SCL.80).aspx

What |s the bas|c funct|ons for master, msdb, mode|, tempdb databases?
1he Moster daLabase holds lnformaLlon for all daLabases locaLed on Lhe SCL Server
lnsLance and ls Lhe alue LhaL holds Lhe enalne LoaeLher. 8ecause SCL Server cannoL
sLarL wlLhouL a funcLlonlna masLer daLabase, vou musL admlnlsLer Lhls daLabase wlLh
care.
1he msdb daLabase sLores lnformaLlon reaardlna daLabase backups, SCL AaenL
lnformaLlon, u1S packaaes, SCL Server [obs, and some repllcaLlon lnformaLlon such
as for loa shlpplna.
1he tempdb holds Lemporarv ob[ecLs such as alobal and local Lemporarv Lables and
sLored procedures.
1he mode/ ls essenLlallv a LemplaLe daLabase used ln Lhe creaLlon of anv new user
daLabase creaLed ln Lhe lnsLance.

What are pr|mary keys and fore|gn keys?
Primory keys are Lhe unlque ldenLlflers for each row. 1hev musL conLaln unlque
values and cannoL be null. uue Lo Lhelr lmporLance ln relaLlonal daLabases, rlmarv
kevs are Lhe mosL fundamenLal of all kevs and consLralnLs. A Lable can have onlv one
rlmarv kev.
loreion keys are boLh a meLhod of ensurlna daLa lnLearlLv and a manlfesLaLlon of Lhe
relaLlonshlp beLween Lables.

What |s data |ntegr|ty? Lxp|a|n constra|nts?
uaLa lnLearlLv ls an lmporLanL feaLure ln SCL Server. When used properlv, lL ensures
LhaL daLa ls accuraLe, correcL, and valld. lL also acLs as a Lrap for oLherwlse
undeLecLable buas wlLhln appllcaLlons.
A kIMAk kL consLralnL ls a unlque ldenLlfler for a row wlLhln a daLabase Lable.
Lverv Lable should have a prlmarv kev consLralnL Lo unlquelv ldenLlfv each row and
onlv one prlmarv kev consLralnL can be creaLed for each Lable. 1he prlmarv kev
consLralnLs are used Lo enforce enLlLv lnLearlLv.
A UNICUL consLralnL enforces Lhe unlqueness of Lhe values ln a seL of columns, so no
dupllcaLe values are enLered. 1he unlque kev consLralnLs are used Lo enforce enLlLv
lnLearlLv as Lhe prlmarv kev consLralnLs.
A ICkLIGN kL consLralnL prevenLs anv acLlons LhaL would desLrov llnks beLween
Lables wlLh Lhe correspondlna daLa values. A forelan kev ln one Lable polnLs Lo a
prlmarv kev ln anoLher Lable. lorelan kevs prevenL acLlons LhaL would leave rows
wlLh forelan kev values when Lhere are no prlmarv kevs wlLh LhaL value. 1he forelan
kev consLralnLs are used Lo enforce referenLlal lnLearlLv.
A CnLCk consLralnL ls used Lo llmlL Lhe values LhaL can be placed ln a column. 1he
check consLralnLs are used Lo enforce domaln lnLearlLv.
A NC1 NULL consLralnL enforces LhaL Lhe column wlll noL accepL null values. 1he noL
null consLralnLs are used Lo enforce domaln lnLearlLv, as Lhe check consLralnLs.

What are the propert|es of the ke|at|ona| tab|es?
8elaLlonal Lables have slx properLles:
values are aLomlc.
Column values are of Lhe same klnd.
Lach row ls unlque.
1he sequence of columns ls lnslanlflcanL.
1he sequence of rows ls lnslanlflcanL.
Lach column musL have a unlque name.

What |s De-norma||zat|on?
ue-normallzaLlon ls Lhe process of aLLempLlna Lo opLlmlze Lhe performance of a
daLabase bv addlna redundanL daLa. lL ls someLlmes necessarv because currenL
u8MSs lmplemenL Lhe relaLlonal model poorlv. A Lrue relaLlonal u8MS would allow
for a fullv normallzed daLabase aL Lhe loalcal level, whlle provldlna phvslcal sLoraae of
daLa LhaL ls Luned for hlah performance. ue-normallzaLlon ls a Lechnlque Lo move
from hlaher Lo lower normal forms of daLabase modellna ln order Lo speed up
daLabase access.

now to get @@error and @@rowcount at the same t|me?
lf 8owcounL ls checked afLer Lrror checklna sLaLemenL Lhen lL wlll have 0 as Lhe
value of 8ecordcounL as lL would have been reseL.
And lf 8ecordcounL ls checked before Lhe error-checklna sLaLemenL Lhen
5CL-5erver Interv|ew Cuest|ons 4

Lrror would aeL reseL. 1o aeL error and rowcounL aL Lhe same Llme do
boLh ln same sLaLemenL and sLore Lhem ln local varlable. SLLLC1 8C =
8CWCCun1, L8 = L88C8

What |s Ident|ty?
ldenLlLv (or AuLonumber) ls a column LhaL auLomaLlcallv aeneraLes numerlc values. A
sLarL and lncremenL value can be seL, buL mosL u8A leave Lhese aL 1. A Culu column
also aeneraLes numbers, Lhe value of Lhls cannoL be conLroled. ldenLlLv/Culu
columns do noL need Lo be lndexed.

What |s a 5chedu|ed Iobs or What |s a 5chedu|ed 1asks?
Scheduled Lasks leL user auLomaLe processes LhaL run on reaular or predlcLable
cvcles. user can schedule admlnlsLraLlve Lasks, such as cube processlna, Lo run durlna
Llmes of slow buslness acLlvlLv. user can also deLermlne Lhe order ln whlch Lasks run
bv creaLlna [ob sLeps wlLhln a SCL Server AaenL [ob. L.a. 8ack up daLabase, updaLe
SLaLs of 1ables. !ob sLeps alve user conLrol over flow of execuLlon. lf one [ob falls,
user can conflaure SCL Server AaenL Lo conLlnue Lo run Lhe remalnlna Lasks or Lo sLop
execuLlon.

What |s a tab|e ca||ed, |f |t does not have ne|ther C|uster nor Non-c|uster Index?
What |s |t used for?
unlndexed Lable or neop. MlcrosofL ress 8ooks and 8ook Cn Llne (8CL) refers lL as
Peap.
A heap ls a Lable LhaL does noL have a clusLered lndex and, Lherefore, Lhe paaes are
noL llnked bv polnLers. 1he lAM paaes are Lhe onlv sLrucLures LhaL llnk Lhe paaes ln a
Lable LoaeLher.
unlndexed Lables are aood for fasL sLorlna of daLa. Manv Llmes lL ls beLLer Lo drop all
lndexes from Lable and Lhan do bulk of lnserLs and Lo resLore Lhose lndexes afLer
LhaL.

What |s 8C? When does |t used?
8ulkCopv ls a Lool used Lo copv huae amounL of daLa from Lables and vlews. 8C does
noL copv Lhe sLrucLures same as source Lo desLlnaLlon.

now do you |oad |arge data to the 5CL server database?
8ulkCopv ls a Lool used Lo copv huae amounL of daLa from Lables. 8uLk lnSL81
command helps Lo lmporLs a daLa flle lnLo a daLabase Lable or vlew ln a user-
speclfled formaL.

Can we rewr|te subquer|es |nto s|mp|e se|ect statements or w|th [o|ns?
Subquerles can ofLen be re-wrlLLen Lo use a sLandard ouLer [oln, resulLlna ln fasLer
performance. As we mav know, an ouLer [oln uses Lhe plus slan (+) operaLor Lo Lell
Lhe daLabase Lo reLurn all non-maLchlna rows wlLh nuLL values. Pence we comblne
Lhe ouLer [oln wlLh a nuLL LesL ln Lhe WPL8L clause Lo reproduce Lhe resulL seL
wlLhouL uslna a sub-querv.

Can 5CL 5ervers ||nked to other servers ||ke Crac|e?
SCL Server can be llned Lo anv server provlded lL has CLL-u8 provlder from MlcrosofL
Lo allow a llnk. L.a. Cracle has a CLL-u8 provlder for oracle LhaL MlcrosofL provldes Lo
add lL as llnked server Lo SCL Server aroup.

now to know wh|ch |ndex a tab|e |s us|ng?
SLLLC1 Lable_name,lndex_name l8CM user_consLralnLs

now to copy the tab|es, schema and v|ews from one 5CL server to another?
MlcrosofL SCL Server 2000 uaLa 1ransformaLlon Servlces (u1S) ls a seL of araphlcal
Lools and proarammable ob[ecLs LhaL leLs user exLracL, Lransform, and consolldaLe
daLa from dlsparaLe sources lnLo slnale or mulLlple desLlnaLlons.

What |s 5e|f Io|n?
1hls ls a parLlcular case when one Lable [olns Lo lLself, wlLh one or Lwo allases Lo avold
confuslon. A self [oln can be of anv Lvpe, as lona as Lhe [olned Lables are Lhe same. A
self [oln ls raLher unlque ln LhaL lL lnvolves a relaLlonshlp wlLh onlv one Lable. 1he
common example ls when companv have a hlerarchal reporLlna sLrucLure wherebv
one member of sLaff reporLs Lo anoLher.

What |s Cross Io|n?
A cross [oln LhaL does noL have a WPL8L clause produces Lhe CarLeslan producL of
Lhe Lables lnvolved ln Lhe [oln. 1he slze of a CarLeslan producL resulL seL ls Lhe
number of rows ln Lhe flrsL Lable mulLlplled bv Lhe number of rows ln Lhe second
Lable. 1he common example ls when companv wanLs Lo comblne each producL wlLh a
prlclna Lable Lo analvze each producL aL each prlce.

Wh|ch v|rtua| tab|e does a tr|gger use?
lnserLed and ueleLed.
L|st few advantages of 5tored rocedure.
SLored procedure can reduced neLwork Lrafflc and laLencv, boosLlna
appllcaLlon performance.
SLored procedure execuLlon plans can be reused, sLavlna cached ln SCL
Server's memorv, reduclna server overhead.
SLored procedures help promoLe code reuse.
SLored procedures can encapsulaLe loalc. ?ou can chanae sLored
procedure code wlLhouL affecLlna cllenLs.
SLored procedures provlde beLLer securlLv Lo vour daLa.

What |s DataWarehous|ng?
5ub[ect-or|ented, meanlna LhaL Lhe daLa ln Lhe daLabase ls oraanlzed so
LhaL all Lhe daLa elemenLs relaLlna Lo Lhe same real-world evenL or
ob[ecL are llnked LoaeLher,
1|me-var|ant, meanlna LhaL Lhe chanaes Lo Lhe daLa ln Lhe daLabase are
Lracked and recorded so LhaL reporLs can be produced showlna chanaes
over Llme,
Non-vo|at||e, meanlna LhaL daLa ln Lhe daLabase ls never over-wrlLLen or
deleLed, once commlLLed, Lhe daLa ls sLaLlc, read-onlv, buL reLalned for
fuLure reporLlna,
Integrated, meanlna LhaL Lhe daLabase conLalns daLa from mosL or all of
an oraanlzaLlon's operaLlonal appllcaLlons, and LhaL Lhls daLa ls made
conslsLenL.

What |s CL1(CnL|ne 1ransact|on rocess|ng)?
ln CL1 - onllne LransacLlon processlna svsLems relaLlonal daLabase deslan use Lhe
dlsclpllne of daLa modellna and aenerallv follow Lhe Codd rules of daLa normallzaLlon
ln order Lo ensure absoluLe daLa lnLearlLv. uslna Lhese rules complex lnformaLlon ls
broken down lnLo lLs mosL slmple sLrucLures (a Lable) where all of Lhe lndlvldual
aLomlc level elemenLs relaLe Lo each oLher and saLlsfv Lhe normallzaLlon rules.

now do 5CL server 2000 and kML ||nked? Can kML be used to access data?
lOk xML {kOw, 4u1O, xPLlcl1)
?ou can execuLe SCL querles aaalnsL exlsLlna relaLlonal daLabases Lo reLurn resulLs as
xML raLher Lhan sLandard rowseLs. 1hese querles can be execuLed dlrecLlv or from
wlLhln sLored procedures. 1o reLrleve xML resulLs, use Lhe lC8 xML clause of Lhe
SLLLC1 sLaLemenL and speclfv an xML mode of 8AW, Au1C, or LxLlCl1.
OPNxML
CLnxML ls a 1ransacL-SCL kevword LhaL provldes a relaLlonal/rowseL vlew over an
ln-memorv xML documenL. CLnxML ls a rowseL provlder slmllar Lo a Lable or a
vlew. CLnxML provldes a wav Lo access xML daLa wlLhln Lhe 1ransacL-SCL conLexL
bv Lransferrlna daLa from an xML documenL lnLo Lhe relaLlonal Lables. 1hus,
CLnxML allows vou Lo manaae an xML documenL and lLs lnLeracLlon wlLh Lhe
relaLlonal envlronmenL.

What |s an execut|on p|an? When wou|d you use |t? now wou|d you v|ew the
execut|on p|an?
An execuLlon plan ls baslcallv a road map LhaL araphlcallv or LexLuallv shows Lhe daLa
reLrleval meLhods chosen bv Lhe SCL Server querv opLlmlzer for a sLored procedure
or ad-hoc querv and ls a verv useful Lool for a developer Lo undersLand Lhe
performance characLerlsLlcs of a querv or sLored procedure slnce Lhe plan ls Lhe one
LhaL SCL Server wlll place ln lLs cache and use Lo execuLe Lhe sLored procedure or
querv. lrom wlLhln Cuerv Analvzer ls an opLlon called Show LxecuLlon lan"
(locaLed on Lhe Cuerv drop-down menu). lf Lhls opLlon ls Lurned on lL wlll dlsplav
querv execuLlon plan ln separaLe wlndow when querv ls ran aaaln.

now do you |mp|ement one-to-one, one-to-many and many-to-many re|at|onsh|ps
wh||e des|gn|ng tab|es?
Cne-Lo-Cne relaLlonshlp can be lmplemenLed as a slnale Lable and rarelv as Lwo
Lables wlLh prlmarv and forelan kev relaLlonshlps. Cne-Lo-Manv relaLlonshlps are
lmplemenLed bv spllLLlna Lhe daLa lnLo Lwo Lables wlLh prlmarv kev and forelan kev
relaLlonshlps. Manv-Lo-Manv relaLlonshlps are lmplemenLed uslna a [uncLlon Lable
wlLh Lhe kevs from boLh Lhe Lables formlna Lhe composlLe prlmarv kev of Lhe [uncLlon
Lable. lL wlll be a aood ldea Lo read up a daLabase deslanlna fundamenLals LexL book.

What's the d|fference between a pr|mary key and a un|que key?
8oLh prlmarv kev and unlque enforce unlqueness of Lhe column on whlch Lhev are
deflned. 8uL bv defaulL prlmarv kev creaLes a clusLered lndex on Lhe column, where
are unlque creaLes a nonclusLered lndex bv defaulL. AnoLher ma[or dlfference ls LhaL,
prlmarv kev doesn'L allow nuLLs, buL unlque kev allows one nuLL onlv.

What are user def|ned datatypes and when you shou|d go for them?
user deflned daLaLvpes leL vou exLend Lhe base SCL Server daLaLvpes bv provldlna a
descrlpLlve name, and formaL Lo Lhe daLabase. 1ake for example, ln vour daLabase,
Lhere ls a column called lllahL_num whlch appears ln manv Lables. ln all Lhese Lables
lL should be varchar(8). ln Lhls case vou could creaLe a user deflned daLaLvpe called
lllahL_num_Lvpe of varchar(8) and use lL across all vour Lables. See sp_addLvpe,
sp_dropLvpe ln books onllne.

What |s b|t datatype and what's the |nformat|on that can be stored |ns|de a b|t
co|umn?
8lL daLaLvpe ls used Lo sLore boolean lnformaLlon llke 1 or 0 (Lrue or false). unLlll SCL
Server 6.3 blL daLaLvpe could hold elLher a 1 or 0 and Lhere was no supporL for nuLL.
8uL from SCL Server 7.0 onwards, blL daLaLvpe can represenL a Lhlrd sLaLe, whlch ls
nuLL.

Def|ne cand|date key, a|ternate key, compos|te key.
A candldaLe kev ls one LhaL can ldenLlfv each row of a Lable unlquelv. Cenerallv a
candldaLe kev becomes Lhe prlmarv kev of Lhe Lable. lf Lhe Lable has more Lhan one
candldaLe kev, one of Lhem wlll become Lhe prlmarv kev, and Lhe resL are called
alLernaLe kevs. A kev formed bv comblnlna aL leasL Lwo or more columns ls called
composlLe kev.

What are defau|ts? Is there a co|umn to wh|ch a defau|t can't be bound?
A defaulL ls a value LhaL wlll be used bv a column, lf no value ls supplled Lo LhaL
column whlle lnserLlna daLa. luLn1l1? columns and LlmesLamp columns can'L have
defaulLs bound Lo Lhem. See C8LA1L uLlAuL1 ln books onllne.

5CL-5erver Interv|ew Cuest|ons 3

What |s a transact|on and what are ACID propert|es?
A LransacLlon ls a loalcal unlL of work ln whlch, all Lhe sLeps musL be performed or
none. AClu sLands for ALomlclLv, ConslsLencv, lsolaLlon, uurablllLv. 1hese are Lhe
properLles of a LransacLlon. lor more lnformaLlon and explanaLlon of Lhese
properLles, see SCL Server books onllne or anv 8u8MS fundamenLals LexL book.
Lxplaln dlfferenL lsolaLlon levels An lsolaLlon level deLermlnes Lhe dearee of lsolaLlon
of daLa beLween concurrenL LransacLlons. 1he defaulL SCL Server lsolaLlon level ls
8ead CommlLLed. Pere are Lhe oLher lsolaLlon levels (ln Lhe ascendlna order of
lsolaLlon): 8ead uncommlLLed, 8ead CommlLLed, 8epeaLable 8ead, Serlallzable. See
SCL Server books onllne for an explanaLlon of Lhe lsolaLlon levels. 8e sure Lo read
abouL SL1 18AnSAC1lCn lSCLA1lCn LLvLL, whlch leLs vou cusLomlze Lhe lsolaLlon
level aL Lhe connecLlon level. 8ead CommlLLed - A LransacLlon operaLlna aL Lhe 8ead
CommlLLed level cannoL see chanaes made bv oLher LransacLlons unLll Lhose
LransacLlons are commlLLed. AL Lhls level of lsolaLlon, dlrLv reads are noL posslble buL
nonrepeaLable reads and phanLoms are posslble. 8ead uncommlLLed - A LransacLlon
operaLlna aL Lhe 8ead uncommlLLed level can see uncommlLLed chanaes made bv
oLher LransacLlons. AL Lhls level of lsolaLlon, dlrLv reads, nonrepeaLable reads, and
phanLoms are all posslble. 8epeaLable 8ead - A LransacLlon operaLlna aL Lhe
8epeaLable 8ead level ls auaranLeed noL Lo see anv chanaes made bv oLher
LransacLlons ln values lL has alreadv read. AL Lhls level of lsolaLlon, dlrLv reads and
nonrepeaLable reads are noL posslble buL phanLoms are posslble. Serlallzable - A
LransacLlon operaLlna aL Lhe Serlallzable level auaranLees LhaL all concurrenL
LransacLlons lnLeracL onlv ln wavs LhaL produce Lhe same effecL as lf each LransacLlon
were enLlrelv execuLed one afLer Lhe oLher. AL Lhls lsolaLlon level, dlrLv reads,
nonrepeaLable reads, and phanLoms are noL posslble.

CkLA1L INDLk myIndex CN my1ab|e(myCo|umn)What type of Index w||| get
created after execut|ng the above statement?
non-clusLered lndex. lmporLanL Lhlna Lo noLe: 8v defaulL a clusLered lndex aeLs
creaLed on Lhe prlmarv kev, unless speclfled oLherwlse.

What's the max|mum s|ze of a row?
8060 bvLes. uon'L be surprlsed wlLh quesLlons llke 'whaL ls Lhe maxlmum number of
columns per Lable'. 1024 columns per Lable. Check ouL SCL Server books onllne for
Lhe paae LlLled: "Maxlmum CapaclLv SpeclflcaLlons". Lxplaln AcLlve/AcLlve and
AcLlve/asslve clusLer conflauraLlons Popefullv vou have experlence seLLlna up
clusLer servers. 8uL lf vou don'L, aL leasL be famlllar wlLh Lhe wav clusLerlna works and
Lhe Lwo clusLernlna conflauraLlons AcLlve/AcLlve and AcLlve/asslve. SCL Server
books onllne has enouah lnformaLlon on Lhls Loplc and Lhere ls a aood whlLe paper
avallable on MlcrosofL slLe. Lxplaln Lhe archlLecLure of SCL Server 1hls ls a verv
lmporLanL quesLlon and vou beLLer be able Lo answer lL lf conslder vourself a u8A.
SCL Server books onllne ls Lhe besL place Lo read abouL SCL Server archlLecLure. 8ead
up Lhe chapLer dedlcaLed Lo SCL Server ArchlLecLure.

What |s |ock esca|at|on?
Lock escalaLlon ls Lhe process of converLlna a loL of low level locks (llke row locks,
paae locks) lnLo hlaher level locks (llke Lable locks). Lverv lock ls a memorv sLrucLure
Loo manv locks would mean, more memorv belna occupled bv locks. 1o prevenL Lhls
from happenlna, SCL Server escalaLes Lhe manv flne-araln locks Lo fewer coarse-araln
locks. Lock escalaLlon Lhreshold was deflnable ln SCL Server 6.3, buL from SCL Server
7.0 onwards lL's dvnamlcallv manaaed bv SCL Server.

What's the d|fference between DLLL1L 1A8LL and 1kUNCA1L 1A8LL commands?
uLLL1L 1A8LL ls a loaaed operaLlon, so Lhe deleLlon of each row aeLs loaaed ln Lhe
LransacLlon loa, whlch makes lL slow. 18unCA1L 1A8LL also deleLes all Lhe rows ln a
Lable, buL lL won'L loa Lhe deleLlon of each row, lnsLead lL loas Lhe deallocaLlon of Lhe
daLa paaes of Lhe Lable, whlch makes lL fasLer. Cf course, 18unCA1L 1A8LL can be
rolled back. 18unCA1L 1A8LL ls funcLlonallv ldenLlcal Lo uLLL1L sLaLemenL wlLh no
WPL8L clause: boLh remove all rows ln Lhe Lable. 8uL 18unCA1L 1A8LL ls fasLer and
uses fewer svsLem and LransacLlon loa resources Lhan uLLL1L. 1he uLLL1L sLaLemenL
removes rows one aL a Llme and records an enLrv ln Lhe LransacLlon loa for each
deleLed row. 18unCA1L 1A8LL removes Lhe daLa bv deallocaLlna Lhe daLa paaes used
Lo sLore Lhe Lable's daLa, and onlv Lhe paae deallocaLlons are recorded ln Lhe
LransacLlon loa. 18unCA1L 1A8LL removes all rows from a Lable, buL Lhe Lable
sLrucLure and lLs columns, consLralnLs, lndexes and so on remaln. 1he counLer used
bv an ldenLlLv for new rows ls reseL Lo Lhe seed for Lhe column. lf vou wanL Lo reLaln
Lhe ldenLlLv counLer, use uLLL1L lnsLead. lf vou wanL Lo remove Lable deflnlLlon and
lLs daLa, use Lhe u8C 1A8LL sLaLemenL. ?ou cannoL use 18unCA1L 1A8LL on a Lable
referenced bv a lC8LlCn kL? consLralnL, lnsLead, use uLLL1L sLaLemenL wlLhouL a
WPL8L clause. 8ecause 18unCA1L 1A8LL ls noL loaaed, lL cannoL acLlvaLe a Lrlaaer.
18unCA1L 1A8LL mav noL be used on Lables parLlclpaLlna ln an lndexed vlew

Lxp|a|n the storage mode|s of CLA
Check ouL MCLA, 8CLA and PCLA ln SCL Server books onllne for more
lnfomaLlon.

What are the new features |ntroduced |n 5CL 5erver 2000 (or the |atest re|ease of
5CL 5erver at the t|me of your |nterv|ew)? What changed between the prev|ous
vers|on of 5CL 5erver and the current vers|on?
1hls quesLlon ls aenerallv asked Lo see how currenL ls vour knowledae. Cenerallv
Lhere ls a secLlon ln Lhe bealnnlna of Lhe books onllne LlLled "WhaL's new", whlch has
all such lnformaLlon. Cf course, readlna [usL LhaL ls noL enouah, vou should have Lrled
Lhose Lhlnas Lo beLLer answer Lhe quesLlons. Also check ouL Lhe secLlon LlLled
"8ackward CompaLlblllLv" ln books onllne whlch Lalks abouL Lhe chanaes LhaL have
Laken place ln Lhe new verslon.

What are constra|nts? Lxp|a|n d|fferent types of constra|nts.
ConsLralnLs enable Lhe 8u8MS enforce Lhe lnLearlLv of Lhe daLabase auLomaLlcallv,
wlLhouL needlna vou Lo creaLe Lrlaaers, rule or defaulLs. 1vpes of consLralnLs: nC1
nuLL, CPLCk, unlCuL, 8lMA8? kL?, lC8LlCn kL?. lor an explanaLlon of Lhese
consLralnLs see books onllne for Lhe paaes LlLled: "ConsLralnLs" and "C8LA1L 1A8LL",
"AL1L8 1A8LL"

What |s an |ndex? What are the types of |ndexes? now many c|ustered |ndexes can
be created on a tab|e? I create a separate |ndex on each co|umn of a tab|e. What
are the advantages and d|sadvantages of th|s approach?
lndexes ln SCL Server are slmllar Lo Lhe lndexes ln books. 1hev help SCL Server
reLrleve Lhe daLa qulcker. lndexes are of Lwo Lvpes. ClusLered lndexes and non-
clusLered lndexes. When vou creaLe a clusLered lndex on a Lable, all Lhe rows ln Lhe
Lable are sLored ln Lhe order of Lhe clusLered lndex kev. So, Lhere can be onlv one
clusLered lndex per Lable. non-clusLered lndexes have Lhelr own sLoraae separaLe
from Lhe Lable daLa sLoraae. non-clusLered lndexes are sLored as 8-Lree sLrucLures (so
do clusLered lndexes), wlLh Lhe leaf level nodes havlna Lhe lndex kev and lL's row
locaLer. 1he row locaLed could be Lhe 8lu or Lhe ClusLered lndex kev, dependlna up
on Lhe absence or presence of clusLered lndex on Lhe Lable. lf vou creaLe an lndex on
each column of a Lable, lL lmproves Lhe querv performance, as Lhe querv opLlmlzer
can choose from all Lhe exlsLlna lndexes Lo come up wlLh an efflclenL execuLlon plan.
AL Lhe same L lme, daLa modlflcaLlon operaLlons (such as lnSL81, uuA1L, uLLL1L)
wlll become slow, as everv Llme daLa chanaes ln Lhe Lable, all Lhe lndexes need Lo be
updaLed. AnoLher dlsadvanLaae ls LhaL, lndexes need dlsk space, Lhe more lndexes
vou have, more dlsk space ls used.

What |s kAID and what are d|fferent types of kAID conf|gurat|ons?
8Alu sLands for 8edundanL Arrav of lnexpenslve ulsks, used Lo provlde faulL
Lolerance Lo daLabase servers. 1here are slx 8Alu levels 0 Lhrouah 3 offerlna dlfferenL
levels of performance, faulL Lolerance. MSun has some lnformaLlon abouL 8Alu
levels and for deLalled lnformaLlon, check ouL Lhe 8Alu advlsorv board's homepaae

What are the steps you w||| take to |mprove performance of a poor perform|ng
query?
1hls ls a verv open ended quesLlon and Lhere could be a loL of reasons behlnd Lhe
poor performance of a querv. 8uL some aeneral lssues LhaL vou could Lalk abouL
would be: no lndexes, Lable scans, mlsslna or ouL of daLe sLaLlsLlcs, blocklna, excess
recompllaLlons of sLored procedures, procedures and Lrlaaers wlLhouL SL1 nCCCun1
Cn, poorlv wrlLLen querv wlLh unnecessarllv compllcaLed [olns, Loo much
normallzaLlon, excess usaae of cursors and Lemporarv Lables. Some of Lhe Lools/wavs
LhaL help vou LroubleshooLlna performance problems are: SL1 SPCWLAn_ALL Cn,
SL1 SPCWLAn_1Lx1 Cn, SL1 S1A1lS1lCS lC Cn, SCL Server rofller, Wlndows n1
/2000 erformance monlLor, Craphlcal execuLlon plan ln Cuerv Analvzer. uownload
Lhe whlLe paper on performance Lunlna SCL Server from MlcrosofL web slLe. uon'L
foraeL Lo check ouL sql-server-performance.com

What are the steps you w||| take, |f you are tasked w|th secur|ng an 5CL 5erver?
Aaaln Lhls ls anoLher open ended quesLlon. Pere are some Lhlnas vou could Lalk
abouL: referrlna n1 auLhenLlcaLlon, uslna server, daLabse and appllcaLlon roles Lo
conLrol access Lo Lhe daLa, securlna Lhe phvslcal daLabase flles uslna n1lS
permlsslons, uslna an unauessable SA password, resLrlcLlna phvslcal access Lo Lhe SCL
Server, renamlna Lhe AdmlnlsLraLor accounL on Lhe SCL Server compuLer, dlsabllna
Lhe CuesL accounL, enabllna audlLlna, uslna mulLlproLocol encrvpLlon, seLLlna up SSL,
seLLlna up flrewalls, lsolaLlna SCL Server from Lhe web server eLc. 8ead Lhe whlLe
paper on SCL Server securlLv from MlcrosofL webslLe. Also check ouL Mv SCL Server
securlLv besL pracLlces

What |s a dead|ock and what |s a ||ve |ock? now w||| you go about reso|v|ng
dead|ocks?
ueadlock ls a slLuaLlon when Lwo processes, each havlna a lock on one plece of daLa,
aLLempL Lo acqulre a lock on Lhe oLher's plece. Lach process would walL lndeflnlLelv
for Lhe oLher Lo release Lhe lock, unless one of Lhe user processes ls LermlnaLed. SCL
Server deLecLs deadlocks and LermlnaLes one user's process. A llvelock ls one, where
a requesL for an excluslve lock ls repeaLedlv denled because a serles of overlapplna
shared locks keeps lnLerferlna. SCL Server deLecLs Lhe slLuaLlon afLer four denlals and
refuses furLher shared locks. A llvelock also occurs when read LransacLlons
monopollze a Lable or paae, forclna a wrlLe LransacLlon Lo walL lndeflnlLelv. Check ouL
SL1 uLAuLCCk_8lC8l1? and "Mlnlmlzlna ueadlocks" ln SCL Server books onllne.
Also check ouL Lhe arLlcle C169960 from MlcrosofL knowledae base.

What |s b|ock|ng and how wou|d you troub|eshoot |t?
8locklna happens when one connecLlon from an appllcaLlon holds a lock and a
second connecLlon requlres a confllcLlna lock Lvpe. 1hls forces Lhe second connecLlon
Lo walL, blocked on Lhe flrsL. 8ead up Lhe followlna Loplcs ln SCL Server books onllne:
undersLandlna and avoldlna blocklna, Codlna efflclenL LransacLlons. Lxplaln C8LA1L
uA1A8ASL svnLax Manv of us are used Lo creaLlna daLabases from Lhe LnLerprlse
Manaaer or bv [usL lssulna Lhe command: C8LA1L uA1A8AL Mvu8.

8ut what |f you have to create a database w|th two f||egroups, one on dr|ve C and
the other on dr|ve D w|th |og on dr|ve L w|th an |n|t|a| s|ze of 600 M8 and w|th a
growth factor of 15?
1haL's whv belna a u8A vou should be famlllar wlLh Lhe C8LA1L uA1A8ASL svnLax.
Check ouL SCL Server books onllne for more lnformaLlon.

now to restart 5CL 5erver |n s|ng|e user mode? now to start 5CL 5erver |n m|n|ma|
conf|gurat|on mode?
SCL Server can be sLarLed from command llne, uslna Lhe SCLSL8v8.LxL. 1hls LxL has
some verv lmporLanL parameLers wlLh whlch a u8A should be famlllar wlLh. -m ls
5CL-5erver Interv|ew Cuest|ons 6

used for sLarLlna SCL Server ln slnale user mode and -f ls used Lo sLarL Lhe SCL Server
ln mlnlmal conflauraLlon mode. Check ouL SCL Server books onllne for more
parameLers and Lhelr explanaLlons.

As a part of your [ob, what are the D8CC commands that you common|y use for
database ma|ntenance?
u8CC CPLCku8, u8CC CPLCk1A8LL, u8CC CPLCkCA1ALCC, u8CC CPLCkALLCC,
u8CC SPCWCCn1lC, u8CC SP8lnkuA1A8ASL, u8CC SP8lnkllLL eLc. 8uL Lhere are a
whole load of u8CC commands whlch are verv useful for u8As. Check ouL SCL Server
books onllne for more lnformaLlon.

What are stat|st|cs, under what c|rcumstances they go out of date, how do you
update them?
SLaLlsLlcs deLermlne Lhe selecLlvlLv of Lhe lndexes. lf an lndexed column has unlque
values Lhen Lhe selecLlvlLv of LhaL lndex ls more, as opposed Lo an lndex wlLh non-
unlque values. Cuerv opLlmlzer uses Lhese lndexes ln deLermlnlna wheLher Lo choose
an lndex or noL whlle execuLlna a querv. Some slLuaLlons under whlch vou should
updaLe sLaLlsLlcs: 1) lf Lhere ls slanlflcanL chanae ln Lhe kev values ln Lhe lndex 2) lf a
larae amounL of daLa ln an lndexed column has been added, chanaed, or removed
(LhaL ls, lf Lhe dlsLrlbuLlon of kev values has chanaed), or Lhe Lable has been LruncaLed
uslna Lhe 18unCA1L 1A8LL sLaLemenL and Lhen repopulaLed 3) uaLabase ls uparaded
from a prevlous verslon. Look up SCL Server books onllne for Lhe followlna
commands: uuA1L S1A1lS1lCS, S1A1S_uA1L, u8CC SPCW_S1A1lS1lCS, C8LA1L
S1A1lS1lCS, u8C S1A1lS1lCS, sp_auLosLaLs, sp_creaLesLaLs, sp_updaLesLaLs

What are the d|fferent ways of mov|ng data/databases between servers and
databases |n 5CL 5erver?
1here are loLs of opLlons avallable, vou have Lo choose vour opLlon dependlna upon
vour requlremenLs. Some of Lhe opLlons vou have are: 8ACku/8LS1C8L, deLLachlna
and aLLachlna daLabases, repllcaLlon, u1S, 8C, loashlpplna, lnSL81.SLLLC1,
SLLLC1.ln1C, creaLlna lnSL81 scrlpLs Lo aeneraLe daLa.

Lxp|a|n d|fferent types of 8ACkUs ava|a|abe |n 5CL 5erver? G|ven a part|cu|ar
scenar|o, how wou|d you go about choos|ng a backup p|an?
1vpes of backups vou can creaLe ln SCL Sever 7.0+ are lull daLabase backup,
dlfferenLlal daLabase backup, LransacLlon loa backup, fllearoup backup. Check ouL Lhe
8ACku and 8LS1C8L commands ln SCL Server books onllne. 8e prepared Lo wrlLe
Lhe commands ln vour lnLervlew. 8ooks onllne also has lnformaLlon on deLalled
backup/resLore archlLecLure and when one should ao for a parLlcular klnd of backup.

What |s database rep||cat|on? What are the d|fferent types of rep||cat|on you can
set up |n 5CL 5erver?
8epllcaLlon ls Lhe process of copvlna/movlna daLa beLween daLabases on Lhe same or
dlfferenL servers. SCL Server supporLs Lhe followlna Lvpes of repllcaLlon scenarlos: ?
SnapshoL repllcaLlon ? 1ransacLlonal repllcaLlon (wlLh lmmedlaLe updaLlna
subscrlbers, wlLh queued updaLlna subscrlbers) ? Merae repllcaLlon See SCL Server
books onllne for lndepLh coveraae on repllcaLlon. 8e prepared Lo explaln how
dlfferenL repllcaLlon aaenLs funcLlon, whaL are Lhe maln svsLem Lables used ln
repllcaLlon eLc.

now to determ|ne the serv|ce pack current|y |nsta||ed on 5CL 5erver?
1he alobal varlable verslon sLores Lhe bulld number of Lhe sqlservr.exe, whlch ls
used Lo deLermlne Lhe servlce pack lnsLalled. 1o know more abouL Lhls process vlslL
SCL Server servlce packs and verslons.

What are cursors? Lxp|a|n d|fferent types of cursors. What are the d|sadvantages of
cursors? now can you avo|d cursors?
Cursors allow row-bv-row processlna of Lhe resulLseLs. 1vpes of cursors:
SLaLlc, uvnamlc, lorward-onlv, kevseL-drlven. See books onllne for more
lnformaLlon. ulsadvanLaaes of cursors: Lach Llme vou feLch a row from
Lhe cursor, lL resulLs ln a neLwork roundLrlp, where as a normal SLLLC1
querv makes onlv one roundLrlp, however larae Lhe resulLseL ls. Cursors
are also cosLlv because Lhev requlre more resources and Lemporarv
sLoraae (resulLs ln more lC operaLlons). lurLher, Lhere are resLrlcLlons on
Lhe SLLLC1 sLaLemenLs LhaL can be used wlLh some Lvpes of cursors.
MosL of Lhe Llmes, seL based operaLlons can be used lnsLead of cursors.
Pere ls an example: lf vou have Lo alve a flaL hlke Lo vour emplovees
uslna Lhe followlna crlLerla: Salarv beLween 30000 and 40000 - 3000
hlke Salarv beLween 40000 and 33000 - 7000 hlke Salarv beLween
33000 and 63000 - 9000 hlke. ln Lhls slLuaLlon manv developers Lend Lo
use a cursor, deLermlne each emplovee's salarv and updaLe hls salarv
accordlna Lo Lhe above formula. 8uL Lhe same can be achleved bv
mulLlple updaLe sLaLemenLs or can be comblned ln a slnale uuA1L
sLaLemenL as shown below:
uuA1L Lbl_emp SL1 salarv = CASL WPLn salarv 8L1WLLn 30000 Anu
40000 1PLn salarv + 3000 WPLn salarv 8L1WLLn 40000 Anu 33000
1PLn salarv + 7000 WPLn salarv 8L1WLLn 33000 Anu 63000 1PLn
salarv + 10000 Lnu
AnoLher slLuaLlon ln whlch developers Lend Lo use cursors: ?ou need Lo
call a sLored procedure when a column ln a parLlcular row meeLs cerLaln
condlLlon. ?ou don'L have Lo use cursors for Lhls. 1hls can be achleved
uslna WPlLL loop, as lona as Lhere ls a unlque kev Lo ldenLlfv each row.
lor examples of uslna WPlLL loop for row bv row processlna, check ouL
Lhe 'Mv code llbrarv' secLlon of mv slLe or search for WPlLL. WrlLe down
Lhe aeneral svnLax for a SLLLC1 sLaLemenLs coverlna all Lhe opLlons.
Pere's Lhe baslc svnLax: (Also checkouL SLLLC1 ln books onllne for
advanced svnLax).
SLLLC1 selecL_llsL [ln1C new_Lable_] l8CM Lable_source [WPL8L
search_condlLlon] [C8Cu 8? aroup_bv_expresslon] [PAvlnC
search_condlLlon] [C8uL8 8? order_expresslon [ASC | uLSC] ]

What |s a [o|n and exp|a|n d|fferent types of [o|ns.
!olns are used ln querles Lo explaln how dlfferenL Lables are relaLed. !olns also leL vou
selecL daLa from a Lable dependlna upon daLa from anoLher Lable. 1vpes of [olns:
lnnL8 !Clns, Cu1L8 !Clns, C8CSS !Clns. Cu1L8 !Clns are furLher classlfled as LLl1
Cu1L8 !ClnS, 8lCP1 Cu1L8 !ClnS and luLL Cu1L8 !ClnS. lor more lnformaLlon see
paaes from books onllne LlLled: "!oln lundamenLals" and "uslna !olns".

Can you have a nested transact|on?
?es, verv much. Check ouL 8LCln 18An, CCMMl1, 8CLL8ACk, SAvL 18An and
18AnCCun1

What |s an extended stored procedure? Can you |nstant|ate a CCM ob[ect by us|ng
1-5CL?
An exLended sLored procedure ls a funcLlon wlLhln a uLL (wrlLLen ln a proarammlna
lanauaae llke C, C++ uslna Cpen uaLa Servlces (CuS) Al) LhaL can be called from 1-
SCL, [usL Lhe wav we call normal sLored procedures uslna Lhe LxLC sLaLemenL. See
books onllne Lo learn how Lo creaLe exLended sLored procedures and how Lo add
Lhem Lo SCL Server. ?es, vou can lnsLanLlaLe a CCM (wrlLLen ln lanauaaes llke v8,
vC++) ob[ecL from 1-SCL bv uslna sp_CACreaLe sLored procedure. Also see books
onllne for sp_CAMeLhod, sp_CACeLroperLv, sp_CASeLroperLv, sp_CAuesLrov. lor
an example of creaLlna a CCM ob[ecL ln v8 and calllna lL from 1-SCL, see 'Mv code
llbrarv' secLlon of Lhls slLe.

What |s the system funct|on to get the current user's user |d?
uSL8_lu(). Also check ouL oLher svsLem funcLlons llke uSL8_nAML(), S?S1LM_uSL8,
SLSSlCn_uSL8, Cu88Ln1_uSL8, uSL8, SuSL8_Slu(), PCS1_nAML().

What are tr|ggers? now many tr|ggers you can have on a tab|e? now to |nvoke a
tr|gger on demand?
1rlaaers are speclal klnd of sLored procedures LhaL aeL execuLed auLomaLlcallv when
an lnSL81, uuA1L or uLLL1L operaLlon Lakes place on a Lable. ln SCL Server 6.3 vou
could deflne onlv 3 Lrlaaers per Lable, one for lnSL81, one for uuA1L and one for
uLLL1L. lrom SCL Server 7.0 onwards, Lhls resLrlcLlon ls aone, and vou could creaLe
mulLlple Lrlaaers per each acLlon. 8uL ln 7.0 Lhere's no wav Lo conLrol Lhe order ln
whlch Lhe Lrlaaers flre. ln SCL Server 2000 vou could speclfv whlch Lrlaaer flres flrsL or
flres lasL uslna sp_seLLrlaaerorder. 1rlaaers can'L be lnvoked on demand. 1hev aeL
Lrlaaered onlv when an assoclaLed acLlon (lnSL81, uuA1L, uLLL1L) happens on Lhe
Lable on whlch Lhev are deflned. 1rlaaers are aenerallv used Lo lmplemenL buslness
rules, audlLlna. 1rlaaers can also be used Lo exLend Lhe referenLlal lnLearlLv checks,
buL wherever posslble, use consLralnLs for Lhls purpose, lnsLead of Lrlaaers, as
consLralnLs are much fasLer. 1lll SCL Server 7.0, Lrlaaers flre onlv afLer Lhe daLa
modlflcaLlon operaLlon happens. So ln a wav, Lhev are called posL Lrlaaers. 8uL ln SCL
Server 2000 vou could creaLe pre Lrlaaers also. Search SCL Server 2000 books onllne
for lnS1LAu Cl Lrlaaers. Also check ouL books onllne for 'lnserLed Lable', 'deleLed
Lable' and CCLuMnS_uuA1Lu()

1here |s a tr|gger def|ned for IN5Lk1 operat|ons on a tab|e, |n an CL1 system. 1he
tr|gger |s wr|tten to |nstant|ate a CCM ob[ect and pass the new|y |nsterted rows to
|t for some custom process|ng. What do you th|nk of th|s |mp|ementat|on? Can th|s
be |mp|emented better?
lnsLanLlaLlna CCM ob[ecLs ls a Llme consumlna process and slnce vou are dolna lL
from wlLhln a Lrlaaer, lL slows down Lhe daLa lnserLlon process. Same ls Lhe case wlLh
sendlna emalls from Lrlaaers. 1hls scenarlo can be beLLer lmplemenLed bv loaalna all
Lhe necessarv daLa lnLo a separaLe Lable, and have a [ob whlch perlodlcallv checks
Lhls Lable and does Lhe needful.

What |s a se|f [o|n? Lxp|a|n |t w|th an examp|e.
Self [oln ls [usL llke anv oLher [oln, excepL LhaL Lwo lnsLances of Lhe same
Lable wlll be [olned ln Lhe querv. Pere ls an example: Lmplovees Lable
whlch conLalns rows for normal emplovees as well as manaaers. So, Lo
flnd ouL Lhe manaaers of all Lhe emplovees, vou need a self [oln.
C8LA1L 1A8LL emp ( empld lnL, marld lnL, empname char(10) )
lnSL81 emp SLLLC1 1,2,'vvas' lnSL81 emp SLLLC1 2,3,'Mohan' lnSL81
emp SLLLC1 3,nuLL,'Shobha' lnSL81 emp SLLLC1 4,2,'Shrldhar' lnSL81
emp SLLLC1 3,2,'Sourabh'
SLLLC1 L1.empname [Lmplovee], L2.empname [Manaaer] l8CM emp L1,
emp L2 WPL8L L1.marld = L2.empld Pere's an advanced querv uslna a
LLl1 Cu1L8 !Cln LhaL even reLurns Lhe emplovees wlLhouL manaaers
(super bosses)
SLLLC1 L1.empname [Lmplovee], CCALLSCL(L2.empname, 'no manaaer')
[Manaaer] l8CM emp L1 LLl1 Cu1L8 !Cln emp L2 Cn L1.marld =
L2.empld

M|crosoft 5CL 5erver Interv|ew Cuest|ons and Answers

ou have a 5CL 5erver 2005 c|uster and need to add ant|-v|rus software as per your
corporate standards. What shou|d you exc|ude from scans?
Loa and daLa flles for vour daLabases as well as Lhe Cuorum drlve and Lhe backup
folders.
AnLl-vlrus proarams can exlsL on Lhe same server as SCL Server wlLhouL an lssue lf
vou exclude cerLaln lLems. 1he daLabase daLa and loa flles, backup flles and folders,
Lhe quorum drlve for clusLers, Lemporarv repllcaLlon flles, Lhe SCL Server loa flles,
5CL-5erver Interv|ew Cuest|ons 7

and Loa Shlpplna folders/flles. ?ou do noL need Lo exclude LhaL SCL Server
execuLables and probablv do noL wanL Lo so LhaL Lhev are proLecLed.
Cuest|ons to ask a 5CL 5erver database deve|oper app||cant

Can you g|ve me an overv|ew of some of the database ob[ects ava||ab|e for use |n
5CL 5erver 2000?
?ou are looklna for ob[ecLs such as: Lables, vlews, user-deflned funcLlons, and sLored
procedures, lL's even beLLer lf Lhev menLlon addlLlonal ob[ecLs such as Lrlaaers. lL's
noL a aood slan lf an appllcanL cannoL answer Lhls baslc quesLlon.

What |s an |ndex? What types of |ndexes are ava||ab|e |n 5CL 5erver 2000?
Anv experlenced daLabase developer should be able Lo answer Lhls quesLlon wlLh
ease. Some of Lhe less-experlenced developers wlll be able Lo answer lL, buL wlLh a
llLLle less clarlLv.

Weeklv SCL Llps ln vour lnbox
1ech8epubllc's free SCL Server newsleLLer, dellvered each 1uesdav, conLalns hands-
on Llps LhaL wlll help vou become more adepL wlLh Lhls powerful relaLlonal daLabase
manaaemenL svsLem.

AuLomaLlcallv slan up Lodav!
ln lLs mosL slmple Lerms, an lndex ls a daLa sLrucLure used Lo provlde qulck access Lo
daLa ln a daLabase Lable or vlew. ln SCL Server, Lhev come ln Lwo flavors: clusLered
and non-clusLered. ClusLered lndexes sLore Lhe daLa aL Lhe leaf level of Lhe lndex. 1hls
means LhaL whlchever fleld(s) ln vour Lable are lncluded ln Lhe clusLered lndex, Lhev
wlll be sLored ln an orderlv fashlon ln Lhe Lable. 8ecause of Lhls sorLlna, vou can onlv
have one clusLered lndex per Lable. non-clusLered lndexes conLaln a row ldenLlfler aL
Lhe leaf level of Lhe lndex. 1hls row ldenLlfler ls a polnLer Lo a locaLlon of Lhe daLa on
Lhe dlsk. 1hls allows vou Lo have more Lhan one non-clusLered lndex per Lable.

What does NULL mean?
1he value nuLL ls a verv Lrlckv sub[ecL ln Lhe daLabase world, so don'L be surprlsed lf
several appllcanLs Lrlp up on Lhls quesLlon.

1he value nuLL means unknCWn, lL does noL mean '' (empLv sLrlna). Assumlna
AnSl_nuLLS are on ln vour SCL Server daLabase, whlch Lhev are bv defaulL, anv
comparlson Lo Lhe value nuLL wlll vleld Lhe value nuLL. ?ou cannoL compare anv
value wlLh an unknCWn value and loalcallv expecL Lo aeL an answer. ?ou musL use
Lhe lS nuLL operaLor lnsLead.

What |s a pr|mary key? What |s a fore|gn key?
A prlmarv kev ls Lhe fleld(s) ln a Lable LhaL unlquelv deflnes Lhe row ln Lhe Lable, Lhe
values ln Lhe prlmarv kev are alwavs unlque. A forelan kev ls a consLralnL LhaL
esLabllshes a relaLlonshlp beLween Lwo Lables. 1hls relaLlonshlp Lvplcallv lnvolves Lhe
prlmarv kev fleld(s) from one Lable wlLh an ad[olnlna seL of fleld(s) ln anoLher Lable
(alLhouah lL could be Lhe same Lable). 1he ad[olnlna fleld(s) ls Lhe forelan kev.

What are tr|ggers? What are the d|fferent types of tr|ggers |n 5CL 5erver 2000?
lL's verv beneflclal for a poLenLlal daLabase developer Lo know Lhe Lvpes of Lrlaaers
avallable, and how Lo lmplemenL Lhem.

A Lrlaaer ls a speclallzed Lvpe of sLored procedure LhaL ls bound Lo a Lable or vlew ln
SCL Server 2000. ln SCL Server 2000, Lhere are lnS1LAu-Cl Lrlaaers and Al1L8
Lrlaaers. lnS1LAu-Cl Lrlaaers are procedures LhaL execuLe ln place of a uaLa
ManlpulaLlon Lanauaae (uML) sLaLemenL on a Lable. lor example, lf l have an
lnS1LAu-Cl-uuA1L Lrlaaer on 1ableA, and l execuLe an updaLe sLaLemenL on LhaL
Lable, Lhe code ln Lhe lnS1LAu-Cl-uuA1L Lrlaaer wlll execuLe lnsLead of Lhe updaLe
sLaLemenL LhaL l execuLed.

An Al1L8 Lrlaaer execuLes afLer a uML sLaLemenL has Laken place ln Lhe daLabase.
1hese Lvpes of Lrlaaers are verv handv for audlLlna daLa chanaes LhaL have occurred
ln vour daLabase Lables.

now can you ensure that a tab|e named 1ab|e8 w|th a f|e|d named I|d1 w||| on|y
have those va|ues |n the I|d1 f|e|d that are a|so |n the tab|e named 1ab|eA w|th a
f|e|d named I|d1?
1hls relaLlonshlp relaLed quesLlon has Lwo poLenLlal answers. 1he flrsL answer (and
Lhe one LhaL vou wanL Lo hear) ls Lhe use of forelan kev consLralnLs. A forelan kev
consLralnL ls used Lo malnLaln referenLlal lnLearlLv. lL ls used Lo ensure LhaL a fleld ln a
Lable wlll onlv hold values LhaL are alreadv deflned ln anoLher fleld ln a dlfferenL (or
Lhe same) Lable. 1haL fleld ls Lhe candldaLe kev (usuallv a prlmarv kev of Lhe oLher
Lable).

1he oLher opLlon ls Lhe use of Lrlaaers. 1rlaaers can be used Lo ensure Lhe same effecL
of consLralnLs ln a roundabouL wav, buL lL ls much more dlfflculL Lo seL up and
malnLaln, and Lhe performance ls Lvplcallv worse. 8ecause of Lhls, MlcrosofL
recommends LhaL developers use forelan kev consLralnLs lnsLead of Lrlaaers for
malnLalnlna referenLlal lnLearlLv.

What |s a performance cons|derat|on of hav|ng too many |ndexes on a product|on
on||ne transact|on process|ng (CL1) tab|e?
?ou are looklna for Lhe appllcanL Lo make some reference reaardlna daLa
manlpulaLlons. 1he more lndexes on a Lable, Lhe more Llme lL Lakes for Lhe daLabase
enalne Lo updaLe, lnserL, or deleLe daLa, as Lhe lndexes all have Lo be malnLalned as
Lhe daLa manlpulaLlon occurs.

What can be used to ensure that a f|e|d |n a tab|e on|y accepts a certa|n range of
va|ues?
1hls quesLlon can be answered a couple of dlfferenL wavs, buL onlv one answer ls a
"aood" one. 1he answer vou wanL Lo hear ls a Check consLralnL, whlch ls deflned on a
daLabase Lable LhaL llmlLs Lhe values enLered lnLo LhaL column. 1hese consLralnLs are
relaLlvelv easv Lo creaLe, and Lhev are Lhe recommended Lvpe for enforclna domaln
lnLearlLv ln SCL Server.

1rlaaers can also be used Lo resLrlcL Lhe values accepLed ln a fleld ln a daLabase Lable,
buL Lhls soluLlon requlres Lhe Lrlaaer Lo be deflned on Lhe Lable, whlch can hlnder
performance ln cerLaln slLuaLlons. lor Lhls reason, MlcrosofL recommends Check
consLralnLs over all oLher meLhods for resLrlcLlna domaln lnLearlLv.

What |s the d|fference between a return parameter and an CU1U1 parameter?
lf Lhe appllcanL ls able Lo answer Lhls quesLlon correcLlv, Lhe odds are aood LhaL Lhev
have some experlence worklna wlLh sLored procedures.
A reLurn parameLer ls alwavs reLurned bv a sLored procedure, and lL ls meanL Lo
lndlcaLe Lhe success or fallure of Lhe sLored procedure. 1he reLurn parameLer ls
alwavs an ln1 daLa Lvpe.
An Cu1u1 parameLer ls deslanaLed speclflcallv bv Lhe developer, and lL can reLurn
oLher Lvpes of daLa, such as characLers and numerlc values. (1here are some
llmlLaLlons on Lhe daLa Lvpes LhaL can be used as ouLpuL parameLers.) ?ou can use
mulLlple Cu1u1 parameLers ln a sLored procedure, whereas vou can onlv use one
reLurn parameLer.

What |s a corre|ated sub-query? now can these quer|es be usefu|?
1he more seasoned developer wlll be able Lo accuraLelv descrlbe Lhls Lvpe of querv. A
correlaLed sub-querv ls a speclal Lvpe of querv conLalnlna a sub-querv. 1he sub-querv
conLalned ln Lhe querv acLuallv requesLs values from Lhe ouLslde querv, creaLlna a
slLuaLlon slmllar Lo a loop. ?ou can flnd a more deLalled descrlpLlon as Lo how Lhese
speclal Lvpes of querles work ln Lhls arLlcle.

If you rece|ved a "erformance Cr|t|ca|" status |n the 5CL 5erver 2005 rep||cat|on
mon|tor, what does th|s mean?
1he laLencv beLween LransacLlon commlLs aL Lhe publlsher and subscrlber exceeds
Lhe warnlna level.
1hls sLaLus can acLuallv mean Lwo dlfferenL Lhlnas. LlLher Lhe laLencv beLween Lhe
commlL of a LransacLlon aL Lhe publlsher and Lhe same commlL aL Lhe subscrlber ls
exceedlna some level ln a LransacLlonal level or noL enouah rows are belna processed
ln a merae repllcaLlon scenarlo.

Wh|ch of the fo||ow|ng modu|es w|th|n 5CL 5erver 2005 cannot be s|gned w|th a
d|g|ta| s|gnature?
uuL Lrlaaers
uuL Lrlaaers cannoL be slaned, buL all Lhe oLher ob[ecLs can.

What does th|s return?
dec|are @| |nt
se|ect @| = -5
se|ect +@|
-3
1hls wlll reLurn -3 as Lhe resulL. 1he + operaLor funcLlons as a unarv plus operaLor,
whlch means LhaL lL performs no operaLlon on Lhe value lL preceeds.

ou have |nsta||ed a U5 Lng||sh 5CL 5erver 2000 |nstance w|th the defau|t opt|ons,
co||at|on, and sort|ng. What does th|s return:
create tab|e My1ab|e
( Mychar varchar(20))
go
|nsert Mytab|e se|ect 'App|e'
|nsert Mytab|e se|ect 'ant'
|nsert Mytab|e se|ect '8a||'
go
se|ect * from My1ab|e where Mychar ||ke '[^a]'

8all
1hls should reLurn "8all" onlv slnce Lhe ^ operaLor means noL maLchlna Lhe nexL
characLer. ln Lhls case, Lhe flrsL characLer should noL be an "A".

Where does rof||er store |ts temporary data |n 5CL 5erver 2005?
ln Lhe dlrecLorv sLored ln Lhe svsLem varlable 1LM.
rofller uses Lhe locaLlon speclfled for Lhe 1LM svsLem varlable.

What |s the 5erv|ce 8roker Ident|f|er ?
A Culu LhaL ldenLlfles Lhe daLabase on whlch Servlce 8roker ls runnlna.
Lach daLabase has a Servlce 8roker ldenLlfler. 1hls ls a Culu ln Lhe
servlce_broker_Culu column LhaL ldenLlfles Lhe daLabases on whlch Servlce 8roker ls
runnlna. lL ensure LhaL messaaes are dellvered Lo Lhe rlahL daLabase.

ou are |ook|ng to |mport a |arge amount of data from a remote CLLD8 data source
that |s not a text f||e. Wh|ch of the fo||ow|ng techn|ques can you use?
use Lhe selecL * from CLn8CWSL1(8uLk...) command.
SCL Server 2003 lncludes a new opLlon wlLh Lhe CLn8CWSL1 command for aeLLlna
larae amounLs of daLa from an CLLu8 daLa source. lL ls Lhe 8uLk opLlon and works
slmllar Lo Lhe 8uLk lnSL81 command.

5CL-5erver Interv|ew Cuest|ons 8

now are mod|f|ed extents tracked |n 5CL 5erver 2005 (wh|ch |nterna| structures)?
ulfferenLlal Chanae Map and 8ulk Chanae Map
1here are Lwo lnLernal sLrucLures LhaL Lrack exLenLs modlfled bv bulk copv operaLlons
or LhaL have chanaed slnce Lhe lasL full backup. 1hev are Lhe ulfferenLlal Chanaed
Map (uCM) and Lhe 8ulk Chanaed Map (8CM).

What does th|s return?
se|ect (1324 & 1024)

1024
1hls performs a blLwlse Anu operaLlon beLween Lhe Lwo lnLeaers and seLs Lhe resulL
Lo Lhls. Slnce 1024 ls a slnale seL blL ln lL's value, lf Lhe correspondlna blL ls seL Lo 1,
Lhen ln Lhe resulL Lhe blL ls seL Lo 1. ln Lhls case, slnce no oLher blLs would aeneraLe
Lwo 1s, Lhe resulL ls equlvalevL Lo Lhe mask, or 1024.

What does the Log keader agent |n 5CL 5erver 2005 rep||cat|on do?
1hls aaenL reads Lhe publlsher loa for LransacLlons Lo send Lo Lhe dlsLrlbuLor.
1hls aaenL ls Lasked wlLh readlna Lhe LransacLlon loa ln LransacLlonal repllcaLlon and
movlna Lhose LransacLlons LhaL need Lo be repllcaLed Lo Lhe dlsLrlbuLor.

ou are perform|ng an update of your 5ca|ab|e 5hared Database and rece|ve note
that two reports run at the same t|me rece|ved d|fferent resu|ts. 1hese reports
were both run dur|ng your update. What type of update d|d you perform?
A rolllna updaLe
When performlna a rolllna updaLe, dolna Lhe deLach and aLLach on each server as
opposed Lo deLachlna from all Lhen aLLachlna Lo all, lL ls posslble LhaL dlfferenL
reporLlna servers wlll dlsplav dlfferenL resulLs.

What does a @@fetch_status of -2 mean |n 5CL 5erver 2005?
1he row belna feLched ls mlsslna.
1hls means LhaL Lhe row LhaL was belna feLched from Lhe cursor ls mlsslna.

ou want to be sure that your 5ca|ab|e 5hared Database |s as ava||ab|e as poss|b|e.
Wh|ch of the fo||ow|ng |s not needed for th|s?
use uaLabase Mlrrorlna Lo fall over beLween Lhe old reporLlna daLabase and Lhe new
one.
1he updaLe process for a Scalable Shared daLabase wlLh mlnlmal downLlme lnvolves
puLLlna ouL a new copv of Lhe daLabase, deLachlna Lhe old daLabase from each
server, and Lhen aLLachlna Lhe new daLabase Lo each server.

What |s the cost threshho|d for para||e||sm |n 5CL 5erver 2005?
1hls ls Lhe number of seconds LhaL a serlalplan cannoL exceed lf lL ls Lo be used. A
parallel plan ls used lf Lhe esLlmaLe exceeds Lhls value.
1hls ls Lhe Lhreshold aL whlch SCL Server deLermlnes wheLher a serlal or parallel plan
ls Lo be used. When SCL Server calculaLes LhaL a serlal plan exceeds Lhe Lhreshold, lL
wlll elecL Lo use a parallel plan lnsLead.

ou have a 5ca|ab|e 5hared Database setup for report|ng purposes on 5CL2. ou
want to be ab|e to keep a po|nt |n t|me v|ew of the report|ng database each month.
What can you do?
Make a new copv of Lhe producLlon daLabase each monLh and Lhen copv LhaL Lo Lhe
SAn. ALLach lL as a new Scalable Shared uaLabase each monLh Lo Lhe reporLlna
servers.
A Scalable Shared uaLabase does noL supporL daLabase snapshoLs, so vou would have
Lo manuallv creaLe a new daLabase each monLh wlLh Lhe daLa vlew vou need and add
Lhls as a new Scalable Shared uaLabase Lo Lhe SAn and each reporLlna server.

ou have an o|d database that needs to run |n compat|b|||ty mode 65 on your 5CL
5erver 2005 server. Wh|ch framework wou|d you use to manage th|s database
programmat|ca||y?
SCL-uMC
SMC does noL supporL compaLlblllLv modes 60 or 63, so vou would need Lo use uMC
lnsLead.

ou have two 5erv|ce 8roker |nstances runn|ng. Cne |s on 5CL1 w|th the defau|t
co||at|on and the other |s on 5CL2 setup for Irench co||at|on. Wh|ch co||at|on |s
used for 5erv|ce 8roker messages sent between the |nstances?
Servlce 8roker does noL conslder Lhe collaLlon, uslna bvLe-bv-bvLe maLchlna for
names.
nelLher collaLlon ls used. Servlce 8roker operaLes ln a collaLlon lndependenL meLhod
LhaL removes collaLlon lnformaLlon from Lhe messaaes.

What does the max fu||-text craw| range opt|on do?
ueLermlnes Lhe number of parLlLlons used ln an lndex crawl.
1hls opLlon helps opLlmlze Lhe full-LexL lndexlna process bv speclfvlna Lhe number of
parLlLlons Lhe SCL Server uses durlna lndex crawls.

Wh|ch of the fo||ow|ng |s not an a||ocat|on un|t |n 5CL 5erver 2005?
1Lx1_ln_8CW_uA1A
1he Lhree Lvpes of allocaLlon unlLs are: ln_8CW_uA1A, LC8_uA1A, and
8CW_CvL8lLCW_uA1A. Lach heap or lndex has ln_8CW_uA1A whlch holds parL of
Lhe daLa. LC8_uA1A ls used for larae ob[ecL daLa Lvpes and 8CW_CvL8lLCW_uA1A
ls used for varlble lenaLh daLa LhaL causes a row Lo exceed Lhe 8060 bvLe llmlL.

Wh|ch of the fo||ow|ng |s the best use for a 5ca|ab|e 5hared Database |n 5CL 5erver
2005?
A reporLlna daLabase server
A scalable shared daLabase ls a feaLure LhaL allows vou Lo seLup read-onlv daLabase
on a separaLe server for reporLlna purposes. 1hls daLabase provldes an ldenLlcle vlew
of vour daLa from anoLher server.

ou are |oad|ng 100 rows of data |nto a narrow tab|e that |s heav||y used by your
product|on |nventory quer|es. It was recommended that you drop the |ndexes on
the tab|e before the |oad and then rebu||d them after the |oad |s comp|ete. Is th|s
someth|ng you wou|d do?
1hls does noL make sense.
lor such a small number of rows, lL ls unllkelv LhaL dropplna Lhe lndexes wlll lmprove
Lhe performance of vour load. lf Lhls were 100,000 rows, Lhen lL mlahL make sense.

now can 5CL 5erver Agent Ma|| send messages |n 5CL 5erver 2005?
SCL Mall Lhrouah LxLended MAl or uaLabase mall.
SCL Server AaenL Mall can be conflaured Lo use uaLabase Mall or LxLended MAl.

What |s the sca|e of measurement for the cost thresho|d for para||e||sm sett|ng |n
5CL 5erver 2005?
Seconds
1hls value measures Lhe number of seconds for a plan where Lhe opLlmlzer chooses
beLween serlal and parallel plans.

Wh|ch of the fo||ow|ng statements best descr|bes the f||ter capab|||t|es of keport
8u||der?
users can do equals, areaLer Lhan, less Lhan, eLc, plus Lhev can do loalcal Anu, C8,
nC1 operaLlons. users can also aroup fllLers Lo allow more advanced fllLers.
Whlle lL looks a llLLle dlfferenL Lhan vou mav be used Lo, Lhe fllLer bullder ls
reasonablv rlch, allowlna mosL sLandard evaluaLlon Lvpes and rlch boolean
comparlsons. 1he onlv weak spoL ln Lhe seL ls no supporL for LlkL, vou have Lo make
do wlLh CCn1AlnS.

1rue or fa|se, keport 8u||der supports user def|ned run t|me parameters?
1rue
AbsoluLelv Lrue. users can deflne anv porLlon of a fllLer Lo be a run Llme prompL,
leLLlna oLher users easllv chanae Lhe fllLer as needed. noL onlv ls lL easv Lo seL up,
8eporL 8ullder auLomaLlcallv populaLes a llsL of all posslble cholces based on Lhe
column belna fllLered.

Us|ng keport 8u||der that |s bund|ed w|th keport|ng 5erv|ces 2005, wh|ch of the
fo||ow|ng wou|d work as a way to add a der|ved f|e|d to a report?
Add a fleld Lo Lhe model ln 8eporL 8ullder uslna Lhe bullL ln formula/funcLlon supporL
Whlle 8eporL 8ullder cannoL be used Lo bulld or malnLaln models, lL does allow vou
Lo add a vlrLual fleld LhaL exlsLs onlv wlLhln LhaL reporL - Lo Lhe end user lL looks llke
Lhe model ls belna modlfled.

If you abso|ute|y need a report to |ook the same regard|ess of what C5 or v|ew|ng
software |s be|ng used, wh|ch of the fo||ow|ng f||e formats wou|d be the best
cho|ce?
1lll
1lll ls Lhe correcL answer. 8v renderlna as an lmaae Lhere are no concerns abouL
dlfferenL fonLs, problems wlLh paae breaks, eLc. ul's are almosL as aood and more
commonlv used of course, wlLh Lhe advanLaae LhaL documenL maps are LranslaLed Lo
bookmarks LhaL are usable - someLhlna noL posslble wlLh a raw lmaae.

1rue or fa|se, keport 8u||der offers d|rect export to a M|crosoft Access database as
one of |ts supported export opt|ons?
lalse
lalse. SupporLed formaLs lnclude Lxcel, CSv, xML, 1lll, MP1ML, and ul. xML or
CSv could be easllv lmporLed lnLo Access, buL Lhere ls wav Lo add Lhe daLa dlrecLlv
from 8eporL 8ullder

When d|scuss|ng |mage support |n keport 8u||der, wh|ch of the fo||ow|ng |s the
most accurate statement?
users can add one or more lmaaes, buL Lhev wlll appear ln Lhe header or fooLer of
Lhe reporL, Lhev cannoL be added Lo Lhe deLall row. lmaaes LhaL are sLored as row
daLa ln Lhe daLabase can be rendered aL Lhe deLall level.
MulLlple lmaaes can be added, buL Lhev appear ln Lhe header or fooLer dependlna on
where placed on Lhe reporL. 1he onlv wav Lo aeL an lmaae aL Lhe deLall level (row
based) ls Lo have lL be parL of Lhe daLabase and lncluded ln Lhe model.

Us|ng keport 8u||der, wh|ch of the fo||ow|ng |s the best statement about the
formatt|ng opt|ons for 8oo|ean co|umns?
8ooleans are formaLLed as 1rue/lalse and Lhere are no oLher bullL ln opLlons, buL vou
could bulld an expresslon uslna lll LhaL would leL vou do oLher formaLLlna
lrom Lhe formaL dlaloa Lhere are no exLra formaLLlna opLlons for 8ooleans, 8eporL
8ullder renders Lhem as 1rue/lalse. WrlLlna an expresslon LhaL vou add Lo Lhe model
vlew ls Lhe easlesL wav Lo work around Lhls llmlLaLlon.

What |s the eas|est way to capture the 5CL statement for a keport 8u||der report
you're troub|eshoot|ng?
8un rofller
rofller wlll work as lona as vou have permlsslons Lo proflle Lhe server and ls Lhe Lhe
besL soluLlon because lL requlres no chanae Lo Lhe 8eporL Server lLself. 1here ls a wav
Lo loa all reporL SCL Lo a loa flle, buL LhaL opLlon was noL llsLed here and ls beLLer
used lf vou wanL Lo do analvsls raLher Lhan LroubleshooLlna.

5CL-5erver Interv|ew Cuest|ons 9

C||ck|ng I||e, 5ave |n keport 8u||der does wh|ch of the fo||ow|ng?
Saves Lhe reporL Lo Lhe reporL server
llle|Save wrlLes Lhe reporL Lo Lhe 8eporL Server. users have Lhe opLlon Lo also save
Lhe reporL Lo dlsk bv uslna llle|Save Lo llle. 8eporL 8ullder users cannoL modlfv Lhe
model.

Wh|ch of the fo||ow|ng cho|ces show the three report formats supported by keport
8u||der ?
1able, MaLrlx, CharL
8eporL 8ullder can bulld a reporL formaLLed as a Lable, charL, or maLrlx (cross Lab),
buL onlv CnL can be used ln anv alven reporL.

Us|ng keport 8u||der, wh|ch of the fo||ow|ng statements |s correct about formatt|ng
numbers?
users can plck from a small number of predeflned formaLs and Lhev have Lhe opLlon
Lo speclfv a cusLom formaL
1here are alve bullL ln formaLs, aeneral, currencv, percenLaae, Lwo place declmal, and
exponenL. users can also deflne a cusLom formaL uslna a .neL formaL sLrlna.

1rue or fa|se, keport 8u||der supports us|ng the LIkL funct|on |ns|de f||ters?
lalse
1here ls no LlkL supporL, Lhe nexL besL Lhlna ls Lhe CCn1AlnS funcLlon whlch works
as lf vou speclfled boLh a leadlna and Lralllna wlld card.

Wh|ch kAID |eve|s store par|ty |nformat|on?
8Alu 3
Cnlv 8Alu 3 (of Lhose llsLed) conLalns parlLv lnformaLlon.

ou have a |arge tab|e that you w|sh to part|t|on to |mprove performance. 1he
tab|e conta|ns many co|umns of data about customers and you dec|de that bas|c
|nformat|on about each customer w||| rema|n |n the current tab|e. Lxtended
|nformat|on, such as sh|pp|ng |nstruct|ons, secretar|es' names, etc. w||| be moved to
a new tab|e a|ong w|th the k. What type of part|t|on|ng |s th|s?
verLlcal parLlLlonlna
lf vou are movlna some columns from one Lable Lo a new Lable, Lhls ls verLlcal
parLlLlonlna.

Cn wh|ch p|atforms can you use Instant I||e In|t|a||zat|on to |mprove database
growth performance |n 5CL 5erver 2005?
Wlndows 2003 and x ro
8oLh Wlndows 2003 Server and laLer as well as Wlndows x rofesslonal supporL
lnsLanL llle lnlLlallzaLlon.

ou have created a database snapshot on 5CL 5erver 2005 for the sa|es database to
capture the end-of-month act|v|ty. 1he next day your server fa||s and you need to
recover to a standby server us|ng the prev|ous n|ght's backups. now do you recover
the snapshot?
1here ls noLhlna vou can do. 1he snapshoL ls losL.
uaLabase snapshoLs cannoL be backed up, so once Lhe server falled, Lhe daLabase
snapshoL was losL.

Us|ng keport|ng 5erv|ces 2005, |t |s true or fa|se that subreports execute a query
aga|nst the datasource once for every deta|| row |n the report?
1rue
1rue. SubreporLs can be used for a masLer-deLall relaLlonshlp, or Lhe subreporL can
be a separaLe lLem, buL ln elLher case 8S wlll querv Lo aeL Lhe daLa for Lhe reporL once
for each deLall row. lf end users are aolna Lo onlv occaslonallv look aL Lhe daLa vou're
dlsplavlna ln Lhe subreporL or onlv vlew lL for a few rows, a beLLer opLlon ls Lo creaLe
a llnk Lo Lhe oLher reporL.

ou have not|ced |n both your 5CL 5erver 2000 and 2005 |nstances that when a
database grows |n 5CL 5erver, there |s a de|ay |n the database response. Why |s
that?
Cnce Lhe flle ls arown, zeros are wrlLLen Lo Lhe new space, causlna a delav.
When a daLabase flle arows, unless lnsLanL flle lnlLlallzaLlon ls Lurned on, Lhe server
musL allocaLe dlsk space and Lhen wrlLe 0s lnLo all LhaL space. 1hls zero-lna ouL of Lhe
flle creaLes Lhe delav.

Wh|ch ut|||ty |s used to adm|n|ster 5CL 5erver 2005 Not|f|cat|on 5erv|ces |nstances?
nsconLrol.exe
1he nsconLrol appllcaLlon can be used wlLh varlous parameLers Lo admlnlsLer a SCL
Server 2003 noLlflcaLlon Servlces lnsLance

After you've comp|eted a backup for your 5a|es server to d|sk, you want to be sure
that th|s backup |s |ntact and ab|e to be used for restores before wr|t|ng |t to tape.
What command w||| he|p you here?
8LS1C8L vL8ll?CnL?
AfLer a backup flle has been wrlLLen Lo dlsk or Lape, lLs lnLearlLv can be checked wlLh
Lhe 8LS1C8L vL8ll?CnL? command. 1hls command wlll verufv Lhe backup seL ls
compleLe and LhaL Lhe flles are readable.

What |s the resu|t of the fo||ow|ng query?
dec|are @a |nt
dec|are @b |nt

set @a = 5
set @b = 11

se|ect @a = @a ^ @b , @b = @b ^ @a, @a = @a ^ @b
pr|nt '@a = '+convert(varchar,@a)
pr|nt '@b = '+convert(varchar,@b)

a = 11 , b = 3
Pere ls Lhe explanaLlon:

SLep 1
a has Lhe value of 3 and ls blnalrv 101
b has Lhe value of 11 and ls blnalrv 1011

AfLer selecL a = a ^ b , b = b ^ a, a = a ^ b"
Lhe values are
a wlll aeL Lhe value from 101 ^ 1011 = 1110 (=14)
b have sLll Lhe value of 1011 (=11)

SLep 2
AfLer selecL a = a ^ b , b = b ^ a, a = a ^ b"
1he values are
a wlll sLav aL Lhe value 1110 (=14)
b wlll aeL Lhe value from 1011 ^ 1110 = 101 (=3)

SLep 3
AfLer selecL a = a ^ b , b = b ^ a, a = a ^ b"

a wlll aeL Lhe value from 1110 ^ 101 = 1011 (=11)
b wlll sLav aL Lhe value 101 (=3)

Cut of the box keport 8u||der supports two report |eve| f|e|ds that can be shown on
a report. Wh|ch opt|on be|ow has those two opt|ons?
1he currenL fllLer and Lhe number of rows LhaL maLched LhaL fllLer
8v defaulL, Lhe currenL fllLer deflnlLlon and Lhe number of rows LhaL maLched Lhe
fllLer are added Lo Lhe end of Lhe reporL. 1hev can be removed and added back as
needed.

Can a part|cu|ar event |n 5CL 5erver 2005, such as the CkLA1L U5Lk command,
have more than one DDL tr|gger ass|gned to |t?
?es
An evenL can have mulLlple Lrlaaers asslaned Lo lL.

ou acc|dent|y de|ete an app||cat|on from an |nstance of 5CL 5erver 2005
Not|f|cat|on 5erv|ces. nowever you have not removed the database, nor the
app||cat|on ob[ects. Can you re-assoc|ate the app||cat|on w|th the same 55N5
|nstance?
no
?ou cannoL re-assocalLe Lhe appllcaLlon because when vou add Lhe appllcaLlon, SSnS
recreaLes Lhe ob[ecLs. lf Lhev alreadv exlsL, Lhe creaLe falls.

now many users can be added to an app||cat|on ro|e |n 5CL 5erver 2005?
none
1hls ls a Lrlck quesLlons. no users are added Lo appllcaLlon roles. AppllcaLlon roles are
lnvoked bv a user.

What a|gor|thm |s used to encrypt the Database Master key when |t |s created?
1rlple uLS
When vou creaLe a uaLabase MasLer kev, lL ls encrvpLed uslna Lhe password vou
supplv wlLh Lhe 1rlple uLS alaorlLhm.

Wh|ch protoco|s support kerberos authent|cat|on on 5CL 5erver 2005?
1C/l
Cnlv Lhose cllenLs connecLlna wlLh 1C/l can use kerberos auLhenLlcaLlon.

ou have a few new 5CL 5erver 2005 server |nstances and you want to be sure that
5CL authent|cated |og|ns must ab|de by the password po||cy. Cn th|s p|atforms can
you enforce th|s?
Wlndows 2003 Server
?ou can onlv enforce password pollcv on Lhe Wlndows 2003 Server plaLform and
newer.

ou are sett|ng up a nat|ve kML web serv|ce on your 5CL 5erver 2005 to respond to
|nventory requests. now can you you be sure that a 5CA quer|es that are |ook|ng
for a W5DL response w||| be prov|ded?
use Lhe WSuL=uLlAuL1 parameLer ln Lhe creaLe endpolnL sLaLemenL.
When uslna Lhe C8LA1L LnuCln1 command, vou can speclfv Lhe WSuL=uLlAuL1
parameLer Lo aeneraLe a defaulL WSuL response or use WSuL="spname" where
spname ls Lhe name of a cusLom sLored procedure Lo reLurn WSuL responses.

Where can you v|ew the ||st of server-scoped DDL tr|ggers?
1he Cb[ecL Lxplorer for Lhe server has a "1rlaaers" folder.
1he server-scoped uuL Lrlaaers wlll appear ln ManaaemenL SLudlo ln Lhe Cb[ecL
Lxplorer under Lhe "1rlaaers" folder.

ou want to be sure that your report|ng so|ut|ons us|ng a database snapshot are
proper|y protected from d|saster. now can you back up your database snapshots?
?ou cannoL back up a daLabase snapshoL.
A daLabase snapshoL cannoL be backed up or resLored.
5CL-5erver Interv|ew Cuest|ons 10


When you |nsta|| 5CL 5erver 2005 and create a new database, |s a Database Master
key created?
no
A daLabase masLer kev ls noL creaLed when a daLabase ls creaLed. lL musL be creaLed
bv an admlnlsLraLor.

What does the DLALLCCA1L statement do |n 5CL 5erver 2005?
8emove a reference Lo a cursor.
1hls sLaLemenL ls used Lo remove cursor references. lf Lhls ls Lhe lasL reference belna
removed, Lhe cursor's resources are released.

keport 8u||der has no bu||t |n support for source contro|. Wh|ch of the fo||ow|ng
cho|ces cou|d be |mp|emented |f you dec|ded that those reports needed to be
under source contro|?
Pave users save Lhe 8uL flles locallv and check lnLo source conLrol uslna a source
conLrol uLlllLv, or wrlLe code Lo scrlpL Lhem ouL each nlahL and check Lhem lnLo
source conLrol
users can do faux source conLrol bv [usL savlna coples of Lhelr 8uL flles locallv before
Lhev make a chanae. 8evond LhaL, vou elLher Leach Lhem how Lo use a source conLrol
uLlllLv or vou wrlLe a uLlllLv vou can run on a schedule.

5ett|ng the 1kU51WCk1n database property to CN a||ows you to execute the
fo||ow|ng from w|th|n the context of the database
Cb[ecLs from unslaned CL8 assemblles wlLh Lx1L8nAL_ACCLSS or unSAlL
permlsslons
ln order Lo execuLe ob[ecLs from CL8 assemblles wlLh Lx1L8nAL_ACCLSS or unSAlL
permlsslons, Lhe assembv musL elLher be slaned wlLh a kev palr or Lhe daLabase
hosLlna Lhe assemblv musL have Lhe 18uS1WC81P? daLabase properLv seL Lo Cn.
LxecuLlna Lhe oLher answers ls essenLlallv conLrolled bv permlsslons. SeLLlna Lhe
18uS1WC81P? daLabase properLv Lo Cn also allows vou Lo use Lhe LxLCu1L AS
clause Lo allow lmpersonaLlon ouLslde Lhe scope of Lhe daLabase wlLhln Lhe lnsLance
buL Lhls was noL one of Lhe answers.

What too| |s ava||ab|e for ad hoc report|ng by non I1 end users |n keport|ng 5erv|ces
2005?
8eporL 8ullder
8eporL 8ullder ls bundled as parL of 8eporLlna Servlces 2003 and ls LaraeLed aL end
users needlna Lo bulld ad hoc reporLs. 8l ueslan SLudlo could be used, buL Lvplcallv
requlres more Llme and experlence Lo use Lhan Lhe averaae end user wlll be wllllna Lo
lnvesL.

ou have [ust upgraded your 5CL 5erver 2000 |nstance on W|ndows 2000 to 5CL
5erver 2005. ou are |ook|ng to beg|n |mp|ement|ng encrypt|on capab|||t|es and
need to choose an a|gor|thm for your data. Wh|ch of the fo||ow|ng |s not ava||ab|e
to you?
128-blL ALS
Whlle all of Lhese are valld encrvpLlon alaorlLhms on SCL Server 2003, Lhe ALS
alaorlLhms (128-blL, 192-blL, and 236-blL) are noL supporLed on Wlndows x or
Wlndows 2000. 1o use Lhese, vou would need Lo uparde Lo Wlndows 2003.

Wh|ch types of rep||cat|on work w|th Crac|e pub||shers?
SnapshoL and LransacLlonal
Cracle publlshlna wlLh SCL Server works as boLh snapshoL and LransacLlonal
publlcaLlon lssues.

whot does @@textsite return?
1he currenL value of Lhe 1Lx1SlZL opLlon for Lhe SL1 command.
1hls reLurns Lhe currenL value of Lhe 1Lx1SlZL opLlon LhaL can be chanaed wlLh Lhe
SL1 command. 1he defaulL ls 4096 bvLes.

In conf|gur|ng the thesaurus conf|gurat|on f||e for 5CL 5erver 2005 Iu||-1ext 5earch,
you set the d|acr|t|cs_sens|t|ve va|ue to 1. What does th|s mean?
lL means Lhe seLs ln Lhls flle are accenL senslLlve.
1he dlacrlLlcs_senslLlve deLermlnes lf Lhe Lerms ln Lhe expanslon and replacemenL
seLs are accenL senslLlve. A value of 0 means accenL lnsenslLlve and a value of 1
means accenL senslLlve.

8efore a user can bu||d reports us|ng keport 8u||der |n keport|ng 5erv|ces 2005,
wh|ch one of the fo||ow|ng steps must be done f|rst?
8ulld and deplov a model
8eporL 8ullder requlres a model and LhaL model cannoL be deflned uslna 8eporL
8ullder. 1he advanLaae of uslna models ls LhaL users do noL need Lo undersLand SCL
sLaLemenLs Lo bulld a reporL (buL Lhev wlll sLlll beneflL from a baslc undersLandlna of
Lhe relaLlonshlps beLween varlous blLs of daLa)

What does the CkLA1L 5LkVICL statement do |n 5CL 5erver 2005?
1hls sLaLemenL ls used Lo seLup new Lasks for Servlce 8roker queues.
1hls sLaLemenL ls ue Lo creaLe a new Servlce 8roker servlce LhaL ls a seL of Lasks LhaL
are run on messaaes

ou have a 5CL 5erver 2005 sa|es database exper|enc|ng performance prob|ems
because of heavy I/C act|v|ty. ou dec|de to create a snapshot of th|s database
every hour, stored on a separate phys|ca| d|sk array and use that for report|ng
quer|es. nowever the quer|es st||| seem s|ow |mmed|ate|y after snapshot creat|on.
Why?
1he snapshoL sLlll querles Lhe orlalnal daLabase.
1he snapshoL of Lhe producLlon daLabase wlll onlv reduce l/C for chanaed paaes. Anv
daLa LhaL has noL been chanaed wlll be read from Lhe source daLabase, whlch ls ln
Lhls case ls experlenclna heavv l/C lLself.

In keport|ng 5erv|ces 2005, how |s keport 8u||der typ|ca||y dep|oyed to end users?
Cne cllck deplovmenL launched from a menu on Lhe 8eporL Manaaer home paae
Cne cllck deplovmenL ls fasL and easv, users cllck Lhe menu on Lhe 8eporL Manaaer
paae. lL ls noL a web appllcaLlon, buL raLher a .neL Wlnform appllcaLlon.

Nat|ve Web 5erv|ces requ|re what type of endpo|nt |n 5CL 5erver 2005?
P11 endpolnLs
naLlve xML Web Servlces ln SCL Server 2003 requlre P11 endpolnLs Lo
communlcaLe wlLh cllenLs.

If you have a rep||cat|on scenar|o w|th one pub||sher, one d|str|butor and one
subscr|ber and the transact|on |so|at|on |eve| |s not set to ser|a||zab|e, what
happens when a transact|on fa||s on the pub||sher?
lL ls sLlll senL Lo Lhe dlsLrlbuLor and execuLed on Lhe subscrlber.
A LransacLlon LhaL falls ln Lhe publlcaLlon daLabase ls sLlll senL Lo Lhe dlsLrlbuLor and
subscrlber. ?uou can Lrap Lhe error, buL vou would need Lo Lrap lL on Lhe subscrlber
as well.

When creat|ng a fu||-text |ndex on a 8LC8 co|umn (|mage, b|nary or varb|nary)
where a f||e |s stored, what happens |f an |ncorrect f||e pref|x |s stored |n the type
co|umn? (Ior |nstance: |f a word document |s stored |n the |mage or a
varb|nary(MAk) co|umn and the va|ue of the type co|umn |s '.pdf'.
1he row ls noL full-LexL lndexed and an error messaae ls wrlLLen Lo Lhe SCL Server
Lrror Loa
1he answer ls Lhe row ls noL full-LexL lndexed and an error messaae ls wrlLLen Lo Lhe
SCL Server Lrror Loa. no columns ln Lhe row are full-LexL lndexed and an error
messaae ls wrlLLen Lo Lhe SCL Server Lrror Loa.

In 5CL 5erver 2005 Iu||-1ext 5earch, you set up a rep|acement set ||ke th|s:
<rep|acement>
<pat>552k5 </pat>
<sub>5CL 5erver 2005 </sub>
<sub>5CL 5erver 2k5 </sub>
</rep|acement>

A search for "552k5" doesn't return resu|ts w|th f|e|ds that you know conta|n
"552k5". What |s wrong?
1he replacemenL seL does noL reLurn resulLs wlLh Lhe search Lerms, onlv Lhe speclfled
replacemenLs.

In the 5CL 5erver 2005 thesaurus kML conf|gurat|on f||e, what |s the expans|on set?
Lxpanslon seLs are svnonvms for Lhe search Lerm and reLurned as resulLs lf Lhev
appear alona wlLh Lhe search Lerm.
1he expanslon seL ls Lhe aroup of values LhaL are svnonvms and can be subsLlLuLed
for Lhe search Lerm. lor example, an expanslon seL can be "SS2k3", "SCL Server
2003", "SCL2k3". ln Lhls case, flelds wlLh anv of Lhese 3 values would be reLurned as
a resulL for searches on "SCL Server 2003".

ou are |n|t|at|ng a new rep||cat|on subscr|pt|on for one of the remote off|ces, but
don't want to transfer |t across the network. 1he snapshot f||es are 725M8, too
|arge for your CD burner and there |s no tape dr|ve at the remote off|ce. What
feature of 5CL 5erver 2005 wou|d he|p you get the snapshot transferred?
Compressed SnapshoLs
ln SCL Server 2003, vou can speclfv a snapshoL Lo be compressed and lL wlll be
compressed uslna Lhe CA8 formaL. lf lL compresses enouah, vou should be able Lo
burn lL onLo a Cu.

1he 1kU51WCk1n database property |s by defau|t?
Cff
1he correcL answer ls off - 1he 18uS1WC81P? daLabase properLv lndlcaLes wheLher
Lhe lnsLalled lnsLance of SCL Server LrusLs Lhe daLabase such LhaL lL can reach ouL and
perform acLlons ouLslde Lhe daLabase. 8v defaulL lL ls Cll such LhaL Lhe daLabase Lo
reduce cerLaln LhreaLs LhaL can resulL from aLLachlna a daLabase LhaL conLalns
poLenLlallv harmful code

Where are Not|f|cat|on 5erv|ces event messages |ogged |n 5CL 5erver 2005?
ln Lhe Wlndows AppllcaLlon Loa
LvenL messaaes are loaaed ln Lhe Wlndows AppllcaLlon loa.

What wou|d happen when you execute the code be|ow |n Cuery Ana|yzer (5CL
5erver 2000)
U5L Northw|nd
GC
CkLA1L kCCLDUkL sp_who
A5
kIN1 '5UkkI5L'
GC
LkLCU1L sp_who

lnformaLlon abouL currenL SCL Server users and processes ls dlsplaved.
1he explanaLlon could be found ln Lhe 8ooks Cnllne under CreaLlna a SLored
rocedure. Cne of Lhe secLlons, named SvsLem SLored rocedures whlch descrlbes
how SCL Server looks up Lhe svsLem sLored procedure has Lhls noLe: lmporLanL lf anv
5CL-5erver Interv|ew Cuest|ons 11

user-creaLed sLored procedure has Lhe same name as a svsLem sLored procedure, Lhe
user-creaLed sLored procedure wlll never be execuLed.

now |s 1hesaurus data conf|gured |n 5CL 5erver 2005 Iu||-1ext 5earch?
An xML flle ln Lhe flle svsLem named Lsxxx.xml where xxx ls a code.
1he Lhesaurus flle for SCL Server 2003 ls an xML flle conLalnlna daLa and sLored ln
SCL_Server_lnsLall_paLh\MlcrosofL SCL Server\MSSCL.1\MSSCL\l1uA1A\ dlrecLorv.
1here ls one for each lanauaae and lL ls named Lsxxx_.xml, where xxx ls Lhe Lhree
leLLer lanauaae code.

What does a report mode| prov|de |n 5CL 5erver 2005 keport|ng 5erv|ces?
A reporL model provldes famlllar buslness names for daLabase Lables and flelds
A 8eporL model provldes buslness names and Lerms for daLabase flelds and Lables. lL
allows for predeflned relaLlonshlps beLween Lables as well as arouplna lLems
LoaeLher loalcallv.

What can tracer tokens measure |n 5CL 5erver 2005 transact|ona| rep||cat|on?
1 and 3
1racer Lokens measure Lwo Lhlnas. Cne ls Lhe amounL of Llme elapsed beLween a
command belna commlLLed on Lhe publlsher and belna wrlLLen Lo Lhe dlsLrlbuLlon
daLabase. 1he oLher ls from Lhe wrlLlna Lo Lhe dlsLrlbuLlon daLabase and belna
commlLLed Lo a subscrlber. 1hls allows vou Lo deLermlne Lhe laLencles for
LransacLlons movlna Lhrouah vour repllcaLlon Lopoloav.

ou want to scr|pt the execut|on of an Integrat|on 5erv|ces package from the
command ||ne for use from a Un|x schedu|er. What ut|||ty wou|d you use?
dLexec.exe
1he dLexec.exe uLlllLv ls used Lo conflaure and execuLe lnLearaLlon Servlces packaaes
from Lhe command llne.

What does the sq|wb ut|||ty do?
Cpens SCL Server 2003 ManaaemenL SLudlo.
sqlwb.exe acLuallv opens ManaaemenL SLudlo and can be conflaured Lo opLlonallv
open a soluLlon, pro[ecL, or scrlpL flle when lL sLarLs.

ou want to automate the |nsta||at|on of 5CL 5erver 2005 us|ng 5MC for your
custom app||cat|on and ensure that the encrypt|on features are ava||ab|e w|th a
serv|ce master key. What method wou|d you ca|| to create th|s key?
1he 8eaeneraLe meLhod under Lhe ServlceMasLerkev ob[ecL.
1o creaLe a Servlce MasLer kev ln SMC, vou would aeL a handle Lo Lhe
ServlceMasLerkev ob[ecL under Lhe Server ob[ecL and Lhen call Lhe 8eaeneraLe
meLhod.

now can you determ|ne wh|ch 5erv|ce 8roker ports are be|ng used on your server?
Cuerv Lhe svsLem caLaloa vlew: svs.conversaLlon_endpolnLs
1he svsLem caLaloa vlew svs.conversaLlon_endpolnLs wlll show vou whlch Servlce
8roker endpolnLs, and Lherefore porLs, are open on vour server.

In Iu||-1ext 5earch, what |s word break|ng?
ueLermlnlna word boundarles.
Word breaklna lnvolves flndlna Lhe boundarles of a word. 1hls ls dlfferenL for
dlfferenL lanauaaes and SCL Server 2003 lncludes word breakers for 23 lanauaaes.

Can you ca|| Not|f|cat|on 5erv|ces AIs from unmanaged code?
?es, buL onlv for slmple subscrlpLlons.
noLlflcaLlon Servlces can be called from unmanaaed code Lhrouah a CCM lnLerface
for slmple subscrlpLlons onlv. CondlLlon based subscrlpLlons are noL supporLed
Lhrouah CCM lnLerop.

Wh|ch of the fo||ow|ng |s true about the kaw I||e 5ource |n 5CL 5erver 2005
Integrat|on 5erv|ces?
lL does noL supporL an error ouLpuL.
1he raw flle source has onlv one ouLpuL and does noL supporL an error ouLpuL. lL also
reads fasLer Lhan oLher daLa sources because lL has no parslna or LranslaLlon and
does noL use a connecLlon manaaer.

ou w|sh to conf|gure event |ogg|ng for your 5CL 5erver 2005 Not|f|cat|on 5erv|ces
|nstance. Where wou|d you make th|s change?
LdlL Lhe nsservlce.exe.confla flle ln Lhe C:\roaram llles\MlcrosofL SCL
Server\90\noLlflcaLlonServlces\n.n.nnn\bln folder.
LvenL loaalna and mosL noLlflcaLlon Servlces conflauraLlon requlre edlLlna an xML
flle. ln Lhls case, Lhe nSservlce.exe.confla flle ls edlLed Lo seL Lhe approprlaLe edlLlna
level.

Wh|ch of the fo||ow|ng |s not true about the kaw I||e Dest|nt|on connect|on |n 5CL
5erver 2005 Integrat|on 5erv|ces?
lL supporLs 8LC8 ob[ecL daLa.
1he 8aw llle uesLlnaLlon connecLlon does noL use a connecLlon manaaer, supporLs
nuLL daLa, and onlv has one lnpuL. lL also does noL supporL 8LC8 daLa or have an
error ouLpuL.

What message types ex|st |n 5CL 5erver 2005 5erv|ce 8roker?
1hese are deflned for each conLracL.
Lach appllcaLlon LhaL seLs up queues and conLracLs lnslde Servlce 8roker musL deflne
Lhe messaae Lvpes LhaL are valld for Lhe conLracL.

What does the CLILING() funct|on do?
8eLurns Lhe smallesL lnLeaer areaLer Lhan or equal Lo Lhe value passed ln.
CLlLlnC() reLurns Lhe smallesL lnLeaer LhaL ls areaL Lhan or equal Lo Lhe value passed
ln.

What |s a d|a|og conversat|on |n the 5CL 5erver 2005 5erv|ce 8roker.
A dlaloa conversaLlon ls a conversaLlon beLween servlces.
A dlaloa conversaLlon ls a conversaLlon beLween servlces. A conversaLlon lncludes
messaaes belna passed back and forLh as parL of a conLracL.

What |s row vers|on|ng |n 5CL 5erver 2005?
8ow verslonlna keeps a copv of each row for use bv appllcaLlons or LransacLlons Lo
prevenL readers from belna blocked bv wrlLers.
8ow verslonlna ls a meLhod wherebv Lhe daLabase enalne keeps a copv of a row's
daLa as lL exlsLed before Lhe sLarL of a LransacLlon for querles Lo read Lhls daLa and
reduce locklna conLenLlon lf Lhev are conflaured.

What does @@MAk_kLCI5ICN return?
1he maxlmum preclslon for numerlc and declmal daLa.
1hls funcLlon reLurns Lhe maxlmum preclslon for numerlc and declmal daLa as seL on
Lhe server. 1he defaulL for SCL Server 2003 ls 38.

Wh|ch of the fo||ow|ng co|umns can be |ndexed w|th 5CL 5erver 2005 Iu||-1ext
5earch?
char, varchar, nvarchar, and varblnarv, LexL, nLexL, and lmaae
All characLer columns, char, varchar and nvarchar columns lncludlna max, LexL and
nLexL, and lmaae columns are valld for full-LexL searchlna.

When start|ng 5CL 5erver 2005 from the command ||ne, what does the -h sw|tch
do?
1hls swlLch reserves memorv space for PoL-Add memorv meLadaLa, avallable wlLh
AWL enabled.
1hls swlLch ls used wlLh 32-blL SCL Server and AWL Lo reserve memorv Lo reserve
memorv space for PoL-Add memorv meLadaLa.

Ian|ce has two tab|es, Lmp|oyees and Crders. 5he has been asked to prov|de a
report of the number of orders processed by each emp|oyee |n the month of Iune.
If an emp|oyee d|dn't process any orders, the report shou|d ref|ect the emp|oyee's
name and a zero for the number of orders. Wh|ch of the quer|es |s the best one for
Ian|ce to use to return the |nformat|on she has been requested to prov|de?
SLLLC1
L.LasLname + ', ' + L.llrsLname AS [Lmplovee name]
, lSnuLL(C.[# of Crders], 0) [# of Crders]
l8CM dbo.Lmplovees L
LLl1 !Cln (SLLLC1
Lmploveelu
, CCun1(*) [# of Crders]
l8CM dbo.Crders
WPL8L CrderuaLe >= '20060601'
Anu CrderuaLe < '20060701'

C8Cu 8? Lmploveelu) C
Cn L.Lmploveelu = C.Lmploveelu
C8uL8 8? [Lmplovee name]

Whlle lL would seem 8L1WLLn would save !anlce a blL of Lvplna, Lhere ls a problem
wlLh lL. 8L1WLLn corresponds, based on Lhese querles Lo Lhe same as:

WPL8L CrderuaLe >= '20060601' Anu CrderuaL e<= '20060701'
lL's Lhe laLLer one LhaL causes Lhe querv Lo be lncorrecL as lL would poLenLlallv lnclude
orders placed on !ulv 1sL aL mldnlahL (20060701 corresponds Lo !ulv 1, 2006 aL
00:00:00). Whlle Lhls would be unllkelv ln a small reLall envlronmenL, lL ls enLlrelv
posslble ln laraer operaLlons, especlallv Lhose whlch are lnLernaLlonal ln scope.
1herefore, Lhe use of 8L1WLLn ln Lhls case ls noL approprlaLe.
WlLh respecL Lo Lhe C8Cu 8?, lL musL appear ln Lhe subquerv on Lhe Crders Lable,
as alven ln Lhe answer. When lL occurs afLer Lhe LLl1 !Cln, Lhe rows where Lhere ls
an emplovee buL no order for Lhe monLh wlll be losL. Slnce !anlce musL reporL on
emplovees who had no sales, Lhls ls unaccepLable.

In 5CL 5erver 2005, you want to mon|tor your transact|ona| rep||cat|on and
determ|ne how |ong |t takes for a transact|on to move from the pub||sher to a
subscr|ber. What wou|d you use to he|p you do th|s?
1racer 1okens.
?ou can use Lracer Lokens ln SCL Server 2003 repllcaLlon Lo measure laLencles. 1hese
are small amounLs of daLa wrlLLen lnLo vour LransacLlon loas.

now many credent|a|s can one |og|n be mapped to?

1
A credenLlal can be mapped Lo manv loalns, buL a loaln can onlv be mapped Lo one
credenLlal.

ou are |ook|ng to secure your pub||sher to prevent unauthor|zed |og|ns from
access|ng the data through rep||cat|on. Where do you add the ||st of |og|ns that
have access?
Add Lhem Lo Lhe ubllcaLlon Access LlsL ln Lhe publlcaLlon daLabase.
5CL-5erver Interv|ew Cuest|ons 12

All access Lo publlcaLlons ls conLrolled wlLh Lhe ubllcaLlon Access LlsL (AL), whlch ls
slmllar Lo Lhe Wlndows ACLs. A llsL ls creaLed for each publlcaLlon LhaL ls seL up.

What does the LkkCk_kCCLDUkL() funct|on return?
1he name of Lhe sLored procedure LhaL caused an error.
1he L88C8_8CCLuu8L() funcLlon ls placed ln Lhe caLch block of a 18?..CA1CP
consLrucL and reLurns Lhe name of Lhe procedure LhaL caused an error Lo be Lhrown.
Credent|a|s |n 5CL 5erver 2005 are used to access what?
8esources ouLslde Lhe SCL Server
A credenLlal ls used Lo access resources ouLslde of SCL Server. lL conLalns Lhe
auLhenLlcaLlon lnformaLlon needed for accesslna Lhese resources.

Wh|ch of the fo||ow|ng |s an |nva||d f||e name for a database f||e?
none of Lhe above
LxplanaLlon from 8CL: SCL Server 2003 does noL enforce Lhe .mdf, .ndf, and .ldf flle
name exLenslons, buL Lhese exLenslons help vou ldenLlfv Lhe dlfferenL klnds of flles
and Lhelr use.

What does @@opt|ons return?
1he currenL SL1 opLlons for Lhe connecLlon.
1he opLlons varlable reLurns a llsL of Lhe opLlons seL for Lhe currenL connecLlon.
1hls ls reLurned as lnLeaer and each blL ln Lhe lnLeaer represenLs an opLlon.

ou have setup forward|ng for your 5CL 5erver 2005 5erv|ce 8roker queues to
another server. ou ed|t a route to move a queue to a new server. What do you
need to do now to ensure you can recover the routes |n the event of a d|saster?
8ack up Lhe msdb daLabase.
1he rouLes for forwardlna are sLored ln msdb.svs.rouLes. lf vou back up Lhe msdb
daLabase, Lhe rouLes wlll be capLured.

ou are |ook|ng to setup a |arge Not|f|cat|on 5erv|ces app||cat|on and you are
p|ann|ng on a 40G8 database. When |nsta|||ng Not|f|cat|on 5erv|ces, the creat|on
fa||s. What |s the ||ke|y prob|em?
noLlflcaLlon Servlces lnsLallaLlon has a 10 mlnuLe LlmeouL and Lhe daLabase creaLlon
probablv Look lonaer Lhan LhaL.
1he noLlflcaLlon Servlces LlmeouL for daLabase creaLlon ls 10 mlnuLes. lf Lhe daLabase
Lakes lonaer Lo creaLe, Lhe lnsLallaLlon of Lhe lnsLance falls. ?ou need Lo reduce Lhe
slze of Lhe daLabase for lnsLallaLlon and Lhen lncrease lL when vou are done.

ou have enab|ed AWL for your 5CL 5erver 2005 server and a||ocated 4G8 or kAM
on one of your servers. An A5.NL1 app||cat|on on the same server |s fee||ng
memory pressure and you want to re|ease some memory and reduce 5CL 5erver to
3G8 or kAM. now can you do th|s?
Chanae Lhe max amounL of memorv allocaLed and shuL down and resLarL SCL Server
Lo have lL Lake affecL.
Cnce memorv ls allocaLed Lhrouah AWL, lL cannoL be released unless Lhe SCL Server
ls resLarLed.

ou are troub|eshoot|ng a 5erv|ce 8roker app||cat|on and f|nd that messages are
rema|n|ng on the queue. ou determ|ne that there |s no act|ve queue mon|tor.
What shou|d you do?
use Lhe AL1L8 CuLuL sLaLemenL Lo Lurn acLlvaLlon on.
Cne of Lhe LroubleshooLlna sLeps lf messaaes remaln ln Lhe queue ls Lo check for an
acLlve queue monlLor. lf one ls noL on, Lhen lL needs Lo be acLlvaLed. 1he AL1L8
CuLuL sLaLemenL ls used Lo chanae Lhls.

ou are |mp|ement|ng rep||cat|on across the Internet for a |arge bank that w|shes to
move up to date pr|c|ng |nformat|on to an ana|yst's |aptop. 1hey are concerned
about spoof|ng of the|r ma|n s|te by cr|m|na|s. What can you do to secure the
rep||cat|on so|ut|on w|th 5CL 5erver 2005?
SeL Lhe encrvpLlon level Lo verlfv Lhe cerLlflcaLe ls lssued bv a LrusLed auLhorlLv.
Slnce vou are asked Lo use repllcaLlon, a repllcaLlon soluLlon ls Lo use encrvpLlon for
Lhe connecLlon and verlfv Lhe cerLlflcaLe belna used ls from a LrusLed auLhorlLv.
SeLLlna Lhe encrpvLlon level Lo 2 wlll do Lhls.

In 5CL 5erver 2005, you are |ook|ng to |mp|ement fu||-text search. Cne of the tab|es
you are |ook|ng to |ndex stores M|rcrosoft Word documents |n a varb|nary(max)
co|umn. Can you use Iu||-text search to |ndex th|s co|umn?
?es
?ou can use full-LexL search for formaLLed daLa such as Word LhaL conLalns LexL
sLored ln a varblnarv column.

1o recover an |nstance of Not|f|cat|on 5erv|ces |n 2005 on another server, what
|nformat|on wou|d you need?
A backup of Lhe daLabase holdlna noLlflcaLlon Servlces and Lhe xSu and xSL1 flles as
well as Lhe name and password for Lhe servlce accounL.
1o recover SSnS, vou need Lhe daLabase backup as well as Lhe operaLlonal flles, xSu
and xSL1 flles, sLored on Lhe flle svsLem and Lhe accounL lnformaLlon used for Lhe
servlce accounL. Slnce SSnS usuallv works wlLh daLa ouLslde of Lhe SCL Server, a
domaln accounL ls usuallv used Lo ensure proper permlsslons.

What type of connect|v|ty does the readp|pe/makep|pe ut|||ty test?
named lpes
1he readplpe and makeplpe uLlllLv comblnaLlon wlll LesL named plpe connecLlvlLv.

In 5CL 5erver 2005, wh|ch of the fo||ow|ng schema changes are supported for the
pub||cat|on ob[ects of a rep||cated database?
All of Lhe above.
SCL Server 2003 repllcaLed daLabases supporL Lhe followlna schema chanaes for
ob[ecLs:
* AL1L8 1A8LL
* AL1L8 vlLW
* AL1L8 8CCLuu8L
* AL1L8 lunC1lCn
* AL1L8 18lCCL8 (uML onlv)

ou want to d|sab|e the rece|pt of messages |n one of your databases by the 5erv|ce
8roken. now shou|d you do th|s?
AL1L8 uA1A8ASL Sales SL1 ulSA8LL_88CkL8
1o dlsable Lhe recelpL of messaaes, vou can dlsable Lhe Servlce 8roker bv dlsabllna lL
wlLh Lhe AL1L8 uA1A8ASL command. 1he SL1 command ls "ulSA8LL_88CkL8".

ou are bu||d|ng a .NL1 assemb|y that w||| access the reg|stry of the |oca| mach|ne
for a factor used |n a computer co|umn. What perm|ss|on set shou|d you ass|gn |t?
Lx1L8nAL_ACCLSS
1he mosL resLrlcLlve permlsslon seL should alwavs be used for .nL1 assemblles ln
keeplna wlLh a secure SCL Server envlronmenL. Cnlv Lhe Lx1L8nAL_ACCLSS and
unSAlL permlsslon seLs wlll allow realsLrv access and unSAlL permlsslons are noL
requlred.

ou are deve|op|ng secur|ty po||cy for your 5CL 5ervers and have a|| of the data
entry c|erks need|ng access to a ser|es of tab|es. ou create a Data Lntry ro|e and
ass|gn the proper perm|ss|ons as we|| as add the users.
ou then f|nd out that 8ob |s a part of the nk group because of cross tra|n|ng and
needs to use the same ob[ects from the same app||cat|on except for the Vacat|on
tab|e, to wh|ch he shou|d not have access. No co|umn perm|ss|ons are ass|gned.
What shou|d you do?
CreaLe an new role and uLn? permlsslon Lo Lhe vacaLlon Lable for Lhls role. Add 8ob
Lo Lhls role.
1o effecLlvelv handle securlLv, vou wanL Lo mlnlmlze Lhe admlnlsLraLlve burden. 8ob
ls a member of Lhe uaLa LnLrv role, and because of cross Lralnlna, vou do noL wanL Lo
remove hlm from Lhls role, buL vou do need Lo uLn? permlsslon Lo Lhe vacaLlon
Lable. 1he besL wav Lo do Lhls ls wlLh anoLher role speclflcallv Lo uLn? Lhls
permlsslon.

ou are try|ng to track down |ssues w|th a 5CL 5erver 2005 app||cat|on us|ng
rof||er. 1he part of the app||cat|on you are check|ng uses the LkLCU1L A5
statement to change the context of every user to the user 8ob. now can you
determ|ne wh|ch user |s execut|ng statements |n rof||er?
Check Lhe Sesslonloalnname daLa column.
1he SLSSlCnLCClnnAML column, noL shown bv defaulL, wlll conLaln Lhe orlalnal
loaln name of Lhe user even lf Lhelr conLexL has chanaed ln Lhe appllcaLlon.

Assum|ng the co|umn name |s correct, wh|ch of the fo||ow|ng |s a va||d cast
operat|on |n 55I5 _express|on |anguage?
(u1_S18, 20, 1232)[MvColumn]
1he correcL answer ls (u1_S18, 20, 1232)[MvColumn]. 1he casL uses parens and Lhen
Lhe casL Lvpe speclflcaLlon wlLh Lhe _expresslon Lo be converLed afLerwards.

1here are two types of subscr|pt|ons |n 5CL 5erver rep||cat|on. What are they?
ush/ull
1he Lwo Lvpes of subscrlpLlons are push and pull.

What |s the scope of the contro| perm|ss|on |n 5CL 5erver 2005?
lL allows Lhe aranLee Lhe equlvalenL of ownershlp ln LhaL Lhev have all permlsslons
and can aranL Lhem Lo oLhers.
1he ConLrol permlsslon ls equlvalenL Lo asslanlna ownershlp of Lhe securables. All
avallable permlsslons are aranLed Lo Lhe prlnclpal, and Lhev Lhe prlnclpal ln Lurn can
aranL Lhose permlsslons Lo oLhers.

When test|ng connect|v|ty |n 5CL 5erver, you use wh|ch ut|||ty |n con[unct|on w|th
the readp|pe ut|||ty to estab||sh a connect|on?
makeplpe
1he makeplpe uLlllLv ls used wlLh Lhe readplpe uLlllLv Lo LesL connecLlvlLv onlv for
named plpes connecLlons. 1hls uLlllLv has been deprecaLed ln SCL Server 2003.

In rep||cat|on, what |s each set of the source data that |s rep||cated from the source
server ca||ed?
ArLlcle
Lach seL of source daLa LhaL ls repllcaLed ls called an arLlcle.

In 55I5, what |s the d|fference between output co|umns and externa| co|umns?
LxLernal columns represenL Lhe meLa daLa of exLernal daLa sources and ouLpuL
columns are used be daLa flow source adapLers.
CuLpuL columns are used bv all daLa-flow source adapLers and LransformaLlons. 1hev
are noL used bv desLlnaLlon adapLers. uL slmplv, Lhev represenL Lhe meLadaLa of Lhe
daLa flowlna ouL of Lhe componenL. LxLernal columns represenL Lhe meLadaLa of
exLernal daLa sources and desLlnaLlons. As such, onlv source & desLlnaLlon adapLers
have exLernal columns because Lhese are Lhe onlv componenLs whose buffered
plpellne daLa lnLeracLs wlLh Lhese exLernal sources and desLlnaLlons.

ou want to be sure your database server |f proper|y secured. ou have two
|nstances, a defau|t |nstance and a named |nstance |nsta||ed. Wh|ch ports do you
need to open?
5CL-5erver Interv|ew Cuest|ons 13

1433 and a speclflc porL afLer conflaurlna Lhe named lnsLance Lo use LhaL speclflc
porL
named lnsLances musL be conflaured Lo use a speclflc porL and LhaL porL Lhen opened
ln Lhe flrewall.

ou have a re|at|ve|y new 5CL 5erver 2005 and msdb |s corrupt. now can you f|x
th|s database w|thout a restore? (data |oss |s acceptab|e)
SLop Lhe server and resLarL lL wlLh a Lrace flaa Lo allow svsLem daLabases Lo be
deLached. 1hen copv a new verslon from Lhe /lnS1ALL folder.
8v sLarLlna SCL Server wlLh Lrace flaa 3608 vou can deLach Lhe msdb daLabase. ?ou
can copv a new lnlLlal verslon from Lhe lnsLallaLlon Cu.

In 5CL 5erver 2005 Integrat|on 5erv|ces, |f you want to |mport a f|at f||e very qu|ck|y
that conta|ns on|y |nteger data, what type of pars|ng shou|d you use?
lasL arse
1he fasL parse mode LhaL ls seL on columns for a flaL flle source connecLlon can
lmporL a llmlLed seL of daLa Lvpes exLremelv qulcklv.

In a new defau|t 5CL 5erver 2005 |nsta||at|on, what |s the status of the ded|cated
adm|n|strator connect|on?
Lnabled for local connecLlons onlv.
1he dedlcaLed admlnsLraLor connecLlon ls enabled for local connecLlons onlv bv
defaulL.

In the kLLA1A8LL kLAD |so|at|on |eve|, what phenomena |s st||| poss|b|e?
hanLom rows
1he answer ls hanLoms rows. A phanLom row refers Lo Lhe slLuaLlon where vou
execuLe a uML sLaLemenL LhaL reLrleves daLa, and anoLher process mav add new
rows Lhe resulL seL. lor example:
SL1 lSCLA1lCn LLvLL 8LLA1A8LL 8LAu
8LCln 18AnSAC1lCn
SLLLC1 * l8CM Lable
We reLurn Lhe followlna rows:
Columnname
-----------
row1
row2

?ou are auaranLeed Lo aeL back aL leasL Lhese rows, and no oLher user mav deleLe
Lhese rows (Lhe rows are locked wlLh a shared lock) 1hls ls whaL ls referred Lo as a
repeaLable read. Powever, a user mlahL add anoLher row:
SLLLC1 * l8CM Lable
Columnname
-----------
row1
row2
row3

1o prevenL phanLoms, use Lhe SL8lALlZA8LL lsolaLlon level.

ou are des|gn|ng a new server that w||| ho|d 2 |nstances of 5CL 5erver 2005 |n a
conso||dat|on pro[ect. Cne of the ex|st|ng servers has 4G8 of kAM and the other
has 2G8. ou do not want e|ther |nstance to fee| memory pressure, so you spec|fy a
new server w|th 8G8 of kAM. What e|se shou|d you conf|gure on these |nstances?
Mln and Max memorv for each lnsLance
lf vou are deslanlna mulLlple lnsLances, vou wlll wanL Lo speclfv Lhe amounL of 8AM
LhaL each has access Lo. lf vou do noL do Lhls, performance can varv dramaLlcallv as
Lhe servers compeLe for memorv.

ou have spec|f|ed that a 5CL 5erver 2005 |og|n must respect the password po||cy
on a W|ndows k host. Wh|ch of the fo||ow|ng are va||d passwords for the user
kenda||?
All of Lhe above are valld
Cn a Wlndows x hosL, Lhe password pollcv ls noL enforced because Lhe approprlaLe
Al call ls noL avallable on Lhe operaLlna svsLem.

A cert|f|cate |s wh|ch type of secur|ty mechan|sm?
AsvmmeLrlc kev
A cerLlflcaLe ls an asvmmeLrlc kev LhaL provldes encrvpLlon ln addlLlon Lo
auLhenLlcaLlon of an enLlLv.

Wh|ch of the fo||ow|ng serv|ces |s |nstance-aware?
Analvsls Servlces
Cf Lhese, onlv Analvsls servlces ls lnsLance-aware.

What What does the term ACID refer to?
An acronvm LhaL descrlbes concurrencv supporL ln a daLabase
1he answer ls an acronvm LhaL descrlbes concurrencv supporL ln a daLabase. AClu ls
an acronvm for Lhe followlna four Lerms:
ALomlclLv - Lverv operaLlon wlLhln a LransacLlon ls LreaLed as a slnaular
operaLlon, elLher all of lLs daLa modlflcaLlons are performed, or none of Lhem ls
performed.
ConslsLencv - Cnce Lhe LransacLlon ls compleLed, Lhe svsLem musL be lefL ln a
conslsLenL sLaLe.
lsolaLlon - lL means LhaL Lhe operaLlons wlLhln a LransacLlon musL be sulLablv
lsolaLed from oLher LransacLlons. ln oLher words, no oLher LransacLlons should
see daLa ln Lhe lnLermedlaLe sLaLe, wlLhln Lhe LransacLlon, unLll lL ls flnallzed.
1hls ls done bv uslna locks.
uurablllLv - Cnce a LransacLlon ls compeLed, all chanaes musL be perslsLed as
requesLed. 1he modlflcaLlons should perslsL ln LoLal even ln Lhe evenL of a
svsLem fallure.

What does th|s return?
5LLLC1 U5Lk_NAML() -- keturns Andy
LkLCU1L A5 1echreparat|on
GC
LkLCU1L A5 5teve
GC
kLVLk1
GC
5LLLC1 U5Lk_NAML()
1echreparaLlon
1he execuLlon conLexL swlLches can be nesLed, so chanalna Lo 1echreparaLlon, Lhen
SLeve, Lhen lssulna a 8everL wlll reLurn vou Lo Lhe conLexL of 1echreparaLlon. 1hls
works ln Lhe same manner as a sLack.

In bu||d|ng a DI report |n keport|ng 5erv|ces 2005, |mages that are or|g|na||y
stored |n [pg format are rendered |n [pg format. What format are |mages rendered
|n |f they were stored or|g|na||y |n another format?
pna
lmaaes sLored orlalnallv ln formaLs oLher Lhan [pa are rendered ln pna formaL.

What does the tab|ed|ff ut|||ty do?
1hls uLlllLv wlll reporL Lhe dlfferences ln daLa beLween Lwo Lables.
1hls uLlllLv wlll reporL Lhe daLa dlfferences beLween Lwo Lables. 1hev musL be allke ln
sLrucLure and alve back Lhe 1-SCL Lo brlna Lhe daLa ln Lhe Lables Lo be Lhe same for
mosL daLaLvpes.

Wh|ch sever|ty |eve|s of errors can be corrected by a user (as opposed to those that
an adm|n|strator or M|crosoft must work to f|x.)
11-16
SeverlLv levels 11-16 are correcLable bv users. 8elow 11, Lhese are lnformaLlonal
warnlnas and noL ralsed as svsLem errors. Lrrors above 16 musL have an
admlnlsLraLor or MlcrosofL correcL.

What |s the granu|ar|ty |n seconds of the t|mestamp datatype?
1he LlmesLamp daLaLvpe does noL sLore Llme values.
1he answer ls Lhe LlmesLamp daLaLvpe does noL sLore Llme values. 1he beLLer name
for Lhls daLaLvpe ls rowverslon, and lL ls acLuallv a daLabase-wlde unlque varblnarv
value. When vou have a rowverslon column ln a Lable, Lhe value of Lhe rowverslon
column chanaes for each modlflcaLlon Lo each row. 1he value ln Lhe rowverslon
column ls auaranLeed Lo be unlque across all Lables ln Lhe daLaLvpe.

ou are sett|ng up the backup scheme for your 5CL 5erver 2005 server and want to
setup n|ght|y fu|| backups and hour|y |og backups |n the Ma|ntenance |ans
subsystem. now many p|ans must you setup?
2
Slnce vou have Lwo separaLe schedules for Lhe malnLenance operaLlons, vou wlll
need Lo have Lwo separaLe plans Lo handle Lhls need. Lach plan can onlv be execuLed
on one schedule, so one ls needed for a slnale dallv execuLlon, Lhe nlahLlv full
backups, and anoLher for Lhe hourlv loa backups.

ou have |nsta||ed one new assemb|y on your 5CL 5erver 2005 server and are
wonder|ng |f |t |s be|ng used on the product|on server. now can you eas||y mon|tor
to see |f th|s assemb|y |s be|ng used?
?ou can monlLor Lhe Assemblv Load evenL ln a Lrace.
Whlle vou could scan Lrace resulLs for Lhe names of funcLlons and procedures uslna
Lhe assemblv, lL ls posslble LhaL vou mav noL know all Lhe places Lhe assemblv ls
belna called from. 1here ls a CL8 Load evenL class LhaL wlll capLure an evenL when a
CL8 class ls execuLed.

ou w|sh to ensure you can recover your 5CL 5erver 2005 database to a po|nt |n
t|me |f necessary. Wh|ch recovery mode|s can you use?
lull
Cnlv Lhe lull recoverv model supporLs polnL ln Llme resLoraLlon of vour daLabase.

Does a root e|ement |n an kML document necessar||y conta|n a|| the content for a
we||-formed document?
?es
8v deflnlLlon, Lhe rooL elemenL ls requlred ln a well-formed xML documenL and lL
conLalns all oLher conLenL nesLed lnslde lL.

Wh|ch of the fo||ow|ng datatypes can be represented |n a 5CL_VAkIAN1 datatype?
none of Lhe above.
1he SCL varlanL Lvpe can sLore all daLaLvpes excepL varchar(max), varblnarv(max),
xml, LexL, nLexL, rowverslon/LlmesLamp (LhouahL Lhe daLa of a rowverslon can be
sLored ln a blnarv(8), whlch can be sLored ln a sql_varlanL) and sql_varlanL (lL mav
seem sLranae LhaL vou can'L sLore a varlanL ln a varlanL, buL all Lhls ls savlna ls LhaL
Lhe sql_varlanL daLa Lvpe doesn'L acLuallv exlsL as such-SCL Server chooses Lhe besL
Lvpe of sLoraae Lo sLore Lhe value vou alve Lo lL).

What's the d|fference between a server |og|n and a database user?
A server loaln connecLs an accounL Lo Lhe server. A daLabase user Lhe llnk from Lhe
5CL-5erver Interv|ew Cuest|ons 14

server loaln Lo a deflned daLabase .
?ou need Lo creaLe a server loaln uslna C8LA1L LCCln before vou can Lhen llnk lL Lo a
daLabase uslna a daLabase user wlLh C8LA1L uSL8. 1he server loaln loas lnLo Lhe
server and aranLs access Lo anv server wlde permlsslons. 1he server loaln ls Lhen
mapped Lo a daLabase user for access Lo daLabase ob[ecLs.

Ior regu|atory reasons, you must ma|nta|n an exact text copy of your kML
documents |n your 5CL 5erver 2005 database. What datatype of storage shou|d you
choose?
varchar(max)
1he xML daLa Lvpe chanaes Lhe represenLaLlon of vour xML documenL lnLo an
lnLernal, opLlmlzed verslon LhaL has all Lhe conLenL, buL mav noL malnLaln Lhe orlalnal
LexL. 1he varchar(max) or nvarchar(max) represenaLlons should be used ln Lhls case.

What |s a bookmark |ookup?
An operaLlon where Lhe row ln Lhe heap or clusLered lndex ls found from Lhe
bookmark ln Lhe lndex.
A bookmark lu ls sLored ln an lndex and polnLs back Lo Lhe acLual row ln Lhe heap or
clusLered lndex of Lhe Lable. 1he lookup operaLlon occurs when an lndex saLlsfles a
search and Lhe acLual row ls reLrleved from Lhe Lable.

esterday's CCD now are comments denoted |n an kML document?
WlLh Lhe <!-- and --> markers.
CommenLs ln an xML documenL are denoLed [usL as Lhev are ln P1ML wlLh Lhe
markers.

now secure are encrypted stored procedures, tr|ggers and v|ews?
1hev are noL reallv secure, LhaL are onlv obfusLlcaLed. 1here are Lools LhaL vou can
use Lo aeL aL Lhe code.
1he code lLself ls [usL obfusLlcaLed. Powever, vou cannoL edlL Lhe code, Lhe sLored
procedure or vlew would have Lo be dropped and re-creaLed. 8v comblna Lhls facL
wlLh a uuL Lrlaaer LhaL execuLes on ob[ecL creaLlon vou can Lell when lL has been
modlfled.

ou have created a new assemb|y and want to test |t on 5CL 5erver 2005. ou
|nsta|| the deve|oper ed|t|on w|th defau|ts on your workstat|on and create the
assemb|y as a sysadm|n. ou then wr|te a funct|on to use th|s assemb|y, but |t does
not work. What cou|d be the prob|em?
1he CL8 envlronmenL needs Lo be enabled.
8v defaulL on SCL Server 2003, Lhe CL8 runLlme envlronmenL, whlch ls whaL execuLes
Lhe .nL1 assemblles, ls noL enabled. ?ou need Lo execuLe Lhe followlna code Lo
enable lL:

1he 5erv|ce 8roker operates on messages |n wh|ch fash|on?
Llke a queue, flrsL ln, flrsL ouL.
Messaaes Lransferred ln Servlce 8roker work ln a queue fashlon wlLh Lhe flrsL
messaae belna senL belna Lhe flrsL processed.

ou have a user that agrees to take over some of the database adm|n|strat|on for
your 5CL 5erver 2005. 1hey w||| be |n charge of grant|ng access to one part|cu|ar
database used by the t|me card app||cat|on for server |og|ns. What secur|ty ro|e
shou|d you ass|gn them?
db_accessadmln
1hls user wlll noL add loalns, buL raLher aranL daLabase level access for exlsLlna loalns,
Lherefore Lhe mlnlmum role Lhev need ls Lhe db_accessadmln flxed daLabase role.
1hls allows Lhem Lhe ablllLv Lo add access for Wlndows loalns, Wlndows aroup loalns,
or SCL Server loalns.

What does th|s method |n 5CL 5erver 2005's 5MC equate to |n 1-5CL?
db.Check1ab|es(kepa|r1ype.None)
u8CC CPLCku8 Wl1P nC_lnlCMSCS
1hls SMC meLhod execuLes a u8CC CPLCku8 wlLh Lhe nC_lnlCMSCS opLlon seL.

In 5CL 5erver 2005, can you |nc|ude a user-def|ned ro|e as a member of another
user-def|ned ro|e?
?es
?es vou can.

In 5CL 5erver 2005, what does |nstance aware mean for a serv|ce?
1he servlce ls lnsLalled once for each lnsLances on Lhe server.
An lnsLance aware servlce ls one LhaL ls lnsLalled for each lnsLance on Lhe server. An
lnsLance-unaware servlce ls onlv lnsLalled once , no maLLer how manv lnsLances.
lnLearaLlon Servlces ls lnsLance-unaware whereas SCL AaenL ls lnsLance aware.

If you use the LkLCU1L A5 c|ause to |mpersonate a user at a database-scoped |eve|.
Can you execute a query through a ||nked server |f the |mpersonated user has the
r|ghts to do so when norma||y |ogged |n? No trust re|at|onsh|ps ex|st between the
databases.
no
lf vou chanae vour execuLlon conLexL Lo a user, whlch ls scoped aL a daLabase level,
Lhen anv querles Lo llnked servers or oLher daLabases wlll fall. 1here ls a wav around
Lhls resLrlcLlon lf LrusL relaLlonshlps are seLup.

1he nest|ng |eve| for stored procedures |n 5CL 5erver 2005, but how many
databases can you access |ns|de one stored procedure?
8
1he fooLnoLe for nesLed sLored procedures llmlLs Lhe number aL 8.

Is |t poss|b|e to bu||d an |ndex on a v|ew ?
?es
?es, an lndex can be puL on a vlew buL Lhe flrsL lndex musL be a unlque clusLered
lndex.

What does kLVLk1 do |n 5CL 5erver 2005?
8esLores vour prevlous execuLlon conLexL.
lf vou have chanaed vour execuLlon conLexL wlLh LxLCu1L AS, Lhe 8LvL81 sLaLemenL
wlll resLore Lhe lasL conLexL prlor Lo Lhe LxLCU1L A5.

What does 5LND do |n 5CL 5erver 2005?
Sends a servlce broker messaae uslna a conversaLlon.
SLnu ls used Lo send a messaae on an exlsLlna conversaLlon ln Lhe Servlce 8roker
archlLecLure.

In 5CL 5erver 2005, most data for your data types |s stored |n the pages for the
tab|e. 8|nary ob[ects, such as |mage or text, are stored |n LC8 or |arge Cb[ect data
pages. Where |s varchar(max) data stored?
ln LC8 paaes
Slnce Lhe slze resLrlcLlons for varchar(max) are Lhe same as for LexL daLa, Lhls daLa ls
sLored ln LC8 daLa paaes.

What w||| occur w|th the fo||ow|ng code |n 5CL 5erver 2005 |f executed by A||ce?
execute as user = '8ob' w|th no revert
se|ect user_name()
go
revert
se|ect user_name()
go

?ou wlll recelve as resulLs:

bob
An error

1he nC 8LvL81 opLlon wlLh LxLCu1L AS prevenLs Lhe reLurn of execuLlon conLexL Lo
Lhe prevlous value. lf vou run Lhe 8LvL81 sLaLemenL, vou wlll recelve Lhe followlna
error:

ou have to create some 1-5CL that produces an order of p|ayers |n a go|f
tournament. |ayers who f|n|sh on the same number of strokes have to be g|ven
the same f|n|sh|ng p|ace denot|ng that they w||| have an equa| pr|ze amount. What
1-5CL funct|on can ach|eve th|s?
8Ank alonaslde Lhe CvL8 funcLlon where Lhe CvL8 funcLlon uses Lhe plavers number
of sLrokes Laken
1he rank funcLlon wlll reLurn Lhe rank of Lhe row ln Lhe resulL seL. 1les wlll recelve Lhe
same rank. 1he CvL8 clause wlll separaLe ouL Lhe ranklna lnLo parLlLlons and use
Lhose for calculaLlna Lhe proper placemenL of Lhe aolfers.
?ou wanL Lo dlsable Lhe Lrlaaer dLmplovee on Lhe Puman8esources.Lmplovee Lable
ln Lhe SCL Server 2003 AdvenLureWorks sample daLabase. Whlch of Lhe followlna
sLaLemenLs wlll do Lhe Lrlck?

Answer
A and 8

LxplanaLlon
LlLher of Lhe commands ln A and 8 wlll dlsable Lhe Lrlaaer.


ln SCL Server 2003, lf vou wanL Lhe kevs securlna vour daLa Lo explre over Llme, whaL
Lvpe of kev encrvpLlon would vou choose?

Answer
CerLlflcaLes

LxplanaLlon
CerLlflcaLes have an explraLlon daLa assoclaLed wlLh Lhem. 1hls allows vou Lo lssue
Lhem Lo users and force a relssue ln order Lo malnLaln Lhelr access Lo daLa.


Whlch ls laraer ln slze ln SCL Server 2003 lf vou are uslna svmmeLrlc kevs?

Answer
ClpherLexL

LxplanaLlon
ClpherLexL ls laraer and can be calculaLed uslna Lhe followlna formula:
Slze = ( lLCC8 (8 + u)/8LCCk) + 1) * (8LCCk + 8LCCk + 16)
where u ls Lhe daLa slze ln bvLes, 8LCCk ls Lhe block slze (8 or 16, dependlna on
alaorlLhm) and Slze ls Lhe new slze ln bvLes of Lhe clpherLexL.

What resu|t wou|d you expect from th|s statement?
SelecL * from dbo
.Mv1able

All records from [dbo].[Mv1able]
5CL-5erver Interv|ew Cuest|ons 13

1he answer ls all records from [dbo].[Mv1able]. Cuallfled names can lnclude whlLe
space before and afLer Lhe doLs. 8esLrlcLlons applv onlv Lo Lhe names Lhemselves LhaL
mav need quoLed ldenLlflers wlLh embedded whlLe space or lnvalld characLers.

ou are us|ng 5CL 5erver 2005 and you w|sh to f|nd a number of deta||s about
stored procedures created. 1he deta||s |nc|ude date and t|me, the server that
created the stored procedure, the |og|n name and the contents. now wou|d you do
th|s?
CreaLe a uuL Lrlaaer on C8LA1L_8CCLuu8L daLabase evenL
1he answer ls CreaLe a uuL Lrlaaer on C8LA1L_8CCLuu8L daLabase evenL ?ou can
flnd Lhe answer on paae 448 of 8ealnnlna SCL Server 2003 for uevelopers: lrom
novlce Lo rofesslonal

A .NL1 assemb|y runn|ng w|th UN5AIL perm|ss|ons can do wh|ch of the fo||ow|ng?
All of Lhe above
CL8 code runnlna wlLh unSAlL permlsslons can access vlrLuallv anv resource lnslde
or ouLslde of SCL Server wlLhouL resLrlcLlon. 1hls ls one reason onlv a svsadmln can
creaLe an assemblv as unSAlL.

What does the 5CL Wr|ter serv|ce do?
Pandles volume Shadow Servlce Copv funcLlons.
1he SCL WrlLer servlce was lnLroduced Lo handle access Lo Lhe daLa flles ln SCL
Server. lL allows backup proarams, llke vSS, Lo funcLlon whlle SCL Server ls sLlll
runnlna.

Wh|ch key prov|des the strongest encrypt|on?
ALS (236 blL)
1he lonaer Lhe kev, Lhe beLLer Lhe encrvpLlon, so choose lonaer kevs for more
encrvpLlon. Powever Lhere ls a laraer performance penalLv for lonaer kevs. uLS ls a
relaLlvelv old and weaker alaorlLhm Lhan ALS.

ou are de|egat|ng perm|ss|ons on your 5CL 5erver 2005 server to other
adm|n|strators. ou have |oca|, s|ng|e server [obs on one server that you wou|d ||ke
to a||ow another adm|n|ster to start, stop, and v|ew the h|story for, but not de|ete
h|story. 1h|s adm|n|strator w||| own the [obs. Wh|ch ro|e shou|d you ass|gn?
SCLAaenLuser8ole
SCL Server 2003 provldes 3 flxed roles for Lhe aaenL servlce LhaL llmlL prlvlleaes for
admlnlsLraLors. 1he SCLAaenLuser8ole ls deslaned for local [obs (noL mulLlserver)
LhaL allows Lhe member Lo work wlLh Lhelr owned [obs (edlL, sLarL, sLop, vlew hlsLorv)
wlLhouL deleLlna Lhe hlsLorv of anv [ob.

What |eve| of perm|ss|ons does a user need to create an assemb|y w|th UN5AIL
perm|ss|ons?
svsadmln
Cnlv a svsadmln can creaLe assemblles LhaL are speclfled as unsafe.

Wh|ch opt|ona| 5CL 5erver component must you |nsta|| to ensure that you can
create and execute ma|ntenance p|ans?
SCL Server lnLearaLlon Servlces
?ou musL lnsLall lnLearaLlon Servlces ln order Lo properlv creaLe and execuLe
malnLance plans slnce Lhese plans are a subseL of SSlS packaaes.

ou have t|ght|y secured access to your 5CL 5erver 2005 server by p|ac|ng |t beh|nd
a f|rewa|| and ||m|ted ports 1433 to those c||ents that need to d|rect|y access the
5CL 5erver. Cne of your deve|opers comp|a|ns about connect|ng to the Integrat|on
5erv|ces esrv|ce on your server. What cou|d be the prob|em |f you know the serv|ce
|s work|ng proper|y?
1he flrewall needs Lo allow porL 133 Lhrouah for lnLearaLlon Servlces
lnLearaLlon Servlces requlres access Lo boLh uCCM and porL 133. ?ou need Lo open
Lhls porL Lo allow Lhe developer Lo communlcaLe wlLh SSlS.

In 5CL 5erver 2005, wh|ch network protoco|s use endpo|nts?
All of Lhe above
All communlcaLlon polnLs wlLh SCL Server uslna neLwork proLocols use an endpolnL.
SCL Server creaLes defaulLs for each proLocol LhaL vou enable.

ou have a 5CL 5erver 2005 c|uster and need to add ant|-v|rus software as per your
corporate standards. What shou|d you exc|ude from scans?
Loa and daLa flles for vour daLabases as well as Lhe Cuorum drlve and Lhe backup
folders.
AnLl-vlrus proarams can exlsL on Lhe same server as SCL Server wlLhouL an lssue lf
vou exclude cerLaln lLems. 1he daLabase daLa and loa flles, backup flles and folders,
Lhe quorum drlve for clusLers, Lemporarv repllcaLlon flles, Lhe SCL Server loa flles,
and Loa Shlpplna folders/flles. ?ou do noL need Lo exclude LhaL SCL Server
execuLables and probablv do noL wanL Lo so LhaL Lhev are proLecLed.

What port do you need to open on your server f|rewa|| to enab|e named p|pes
connect|ons?
orL 443
named plpes communlcaLes across 1C porL 443.

When the network serv|ce bu||t-|n account connects to a network resource, what |s
the context?
1he compuLer accounL of Lhe Wlndows lnsLallaLlon.
1he neLwork servlce accounL connecLs Lo neLwork resources as Lhe compuLer accounL
for Lhe Wlndows lnsLallaLlon.

A cert|f|cate |s ||ke wh|ch type of key |n 5CL 5erver 2005 encrypt|on?
An AsvmmeLrlc kev
A cerLlflcaLe ls llke an asvmmeLrlc kev and can valldaLe Lhe ldenLlLv of Lhe lssuer.

now many connect|ons are ava||ab|e |n 5CL 5erver M5DL 2000?
unllmlLed, no dlfferenL from Lhe oLher SCL Server 2000 edlLlons.
1he answer ls acLuallv an unllmlLed number of connecLlons, Lhouah Lhls ln a pracLlcal
sense ls llmlLed bv memorv on Lhe machlne (1he acLual llmlLaLlon ls 32k conneclLons).
lnsLead Lhere ls a aoverner LhaL klcks ln Lo llmlL Lhlnas Lo 8 operaLlons, of whlch 3 are
svsLem operaLlons ln some cases. 8uL Lhese are operaLlons, noL connecLlons.

What w||| be the resu|t of the |ast 5LLLC1 statement |f you execute the 1-5CL scr|pt
be|ow as a sysadm|n.
U5L master
GC
II D8_ID('test_schema') I5 NC1 NULL
DkC DA1A8A5L test_schema
GC
CkLA1L DA1A8A5L test_schema
GC
U5L test_schema
GC
CkLA1L 5CnLMA 5chema1
CkLA1L 1A8LL 1ab|e1 (co|1 |nt)
GC
CkLA1L 5CnLMA 5chema2
GC
CkLA1L 1A8LL 1ab|e1 (co|1 |nt)
GC
5LLLC1 5CnLMA_NAML(schema_|d), name IkCM sys.ob[ects
WnLkL name = '1ab|e1'

Schema1 1able1
dbo 1able1
1he correcL answer ls A. ?ou can comblne Lhe C8LA1L SCPLMA wlLh a C8LA1L 1A8LL.
?ou can even speclfv C8An1s or uLn?s. Search 8ooks onllne for C8LA1L SCPLMA.

ou are cons|der|ng conso||dat|ng a number of your ex|st|ng 5CL 5ervers onto a
new, |arge 5CL 5erver 2005 server. ou have 3 5CL 5erver 6.5 servers, 6 5CL 5erver
7.0 servers, and 16 5CL 5erver 2005 servers. ou cannot make any app||cat|on
changes, but you can s|ze a |arge 5CL 5erver 2005 server to hand|e the d|sk,
memory, and CU needs of the ex|st|ng servers as we|| as set compat|b|||ty modes.
now many of these servers can you conso||date?
23
ln SCL Server 2003, vou can handle a larae number of LransacLlons, whlch makes lL a
aood cholce for consolldaLlna servers. lL lncludes compaLlblllLv modes for SCL Server
6, 6.3, 7 and 2000. 1herefore vou can consolldaLe all Lhe servers, 23 of Lhem, onLo
Lhe new server.

1o ma|nta|n the best performance of your 5CL 5erver 2005 databases, how shou|d
you dep|oy encrypt|on techno|og|es?
LncrvpL daLa wlLh a svmmeLrlc kev and secure all kevs wlLh asvmmeLrlc kevs.
lor performance reasons, vou should encrvpL daLa uslna a svmmeLrlc kev and secure
LhaL kev wlLh an asvmmeLrlc kev.

In 5CL 5erver 2005, wh|ch network protoco|s use endpo|nts?
All of Lhe above
All communlcaLlon polnLs wlLh SCL Server uslna neLwork proLocols use an endpolnL.
SCL Server creaLes defaulLs for each proLocol LhaL vou enable

ou have a 5CL 5erver 2005 c|uster and need to add ant|-v|rus software as per your
corporate standards. What shou|d you exc|ude from scans?
Loa and daLa flles for vour daLabases as well as Lhe Cuorum drlve and Lhe backup
folders.
AnLl-vlrus proarams can exlsL on Lhe same server as SCL Server wlLhouL an lssue lf
vou exclude cerLaln lLems. 1he daLabase daLa and loa flles, backup flles and folders,
Lhe quorum drlve for clusLers, Lemporarv repllcaLlon flles, Lhe SCL Server loa flles,
and Loa Shlpplna folders/flles. ?ou do noL need Lo exclude LhaL SCL Server
execuLables and probablv do noL wanL Lo so LhaL Lhev are proLecLed.

Cuest|ons to ask a 5CL 5erver database deve|oper app||cant

Can you g|ve me an overv|ew of some of the database ob[ects ava||ab|e for use |n
5CL 5erver 2000?
?ou are looklna for ob[ecLs such as: Lables, vlews, user-deflned funcLlons, and sLored
procedures, lL's even beLLer lf Lhev menLlon addlLlonal ob[ecLs such as Lrlaaers. lL's
noL a aood slan lf an appllcanL cannoL answer Lhls baslc quesLlon.

What |s an |ndex? What types of |ndexes are ava||ab|e |n 5CL 5erver 2000?
Anv experlenced daLabase developer should be able Lo answer Lhls quesLlon wlLh
ease. Some of Lhe less-experlenced developers wlll be able Lo answer lL, buL wlLh a
llLLle less clarlLv.

Weeklv SCL Llps ln vour lnbox
1ech8epubllc's free SCL Server newsleLLer, dellvered each 1uesdav, conLalns hands-
on Llps LhaL wlll help vou become more adepL wlLh Lhls powerful relaLlonal daLabase
manaaemenL svsLem.
5CL-5erver Interv|ew Cuest|ons 16


AuLomaLlcallv slan up Lodav!
ln lLs mosL slmple Lerms, an lndex ls a daLa sLrucLure used Lo provlde qulck access Lo
daLa ln a daLabase Lable or vlew. ln SCL Server, Lhev come ln Lwo flavors: clusLered
and non-clusLered. ClusLered lndexes sLore Lhe daLa aL Lhe leaf level of Lhe lndex. 1hls
means LhaL whlchever fleld(s) ln vour Lable are lncluded ln Lhe clusLered lndex, Lhev
wlll be sLored ln an orderlv fashlon ln Lhe Lable. 8ecause of Lhls sorLlna, vou can onlv
have one clusLered lndex per Lable. non-clusLered lndexes conLaln a row ldenLlfler aL
Lhe leaf level of Lhe lndex. 1hls row ldenLlfler ls a polnLer Lo a locaLlon of Lhe daLa on
Lhe dlsk. 1hls allows vou Lo have more Lhan one non-clusLered lndex per Lable.

What does NULL mean?
1he value nuLL ls a verv Lrlckv sub[ecL ln Lhe daLabase world, so don'L be surprlsed lf
several appllcanLs Lrlp up on Lhls quesLlon.

1he value nuLL means unknCWn, lL does noL mean '' (empLv sLrlna). Assumlna
AnSl_nuLLS are on ln vour SCL Server daLabase, whlch Lhev are bv defaulL, anv
comparlson Lo Lhe value nuLL wlll vleld Lhe value nuLL. ?ou cannoL compare anv
value wlLh an unknCWn value and loalcallv expecL Lo aeL an answer. ?ou musL use
Lhe lS nuLL operaLor lnsLead.

What |s a pr|mary key? What |s a fore|gn key?
A prlmarv kev ls Lhe fleld(s) ln a Lable LhaL unlquelv deflnes Lhe row ln Lhe Lable, Lhe
values ln Lhe prlmarv kev are alwavs unlque. A forelan kev ls a consLralnL LhaL
esLabllshes a relaLlonshlp beLween Lwo Lables. 1hls relaLlonshlp Lvplcallv lnvolves Lhe
prlmarv kev fleld(s) from one Lable wlLh an ad[olnlna seL of fleld(s) ln anoLher Lable
(alLhouah lL could be Lhe same Lable). 1he ad[olnlna fleld(s) ls Lhe forelan kev.

What are tr|ggers? What are the d|fferent types of tr|ggers |n 5CL 5erver 2000?
lL's verv beneflclal for a poLenLlal daLabase developer Lo know Lhe Lvpes of Lrlaaers
avallable, and how Lo lmplemenL Lhem.
A Lrlaaer ls a speclallzed Lvpe of sLored procedure LhaL ls bound Lo a Lable or vlew ln
SCL Server 2000. ln SCL Server 2000, Lhere are lnS1LAu-Cl Lrlaaers and Al1L8
Lrlaaers. lnS1LAu-Cl Lrlaaers are procedures LhaL execuLe ln place of a uaLa
ManlpulaLlon Lanauaae (uML) sLaLemenL on a Lable. lor example, lf l have an
lnS1LAu-Cl-uuA1L Lrlaaer on 1ableA, and l execuLe an updaLe sLaLemenL on LhaL
Lable, Lhe code ln Lhe lnS1LAu-Cl-uuA1L Lrlaaer wlll execuLe lnsLead of Lhe updaLe
sLaLemenL LhaL l execuLed.

An Al1L8 Lrlaaer execuLes afLer a uML sLaLemenL has Laken place ln Lhe daLabase.
1hese Lvpes of Lrlaaers are verv handv for audlLlna daLa chanaes LhaL have occurred
ln vour daLabase Lables.

now can you ensure that a tab|e named 1ab|e8 w|th a f|e|d named I|d1 w||| on|y
have those va|ues |n the I|d1 f|e|d that are a|so |n the tab|e named 1ab|eA w|th a
f|e|d named I|d1?
1hls relaLlonshlp relaLed quesLlon has Lwo poLenLlal answers. 1he flrsL answer (and
Lhe one LhaL vou wanL Lo hear) ls Lhe use of forelan kev consLralnLs. A forelan kev
consLralnL ls used Lo malnLaln referenLlal lnLearlLv. lL ls used Lo ensure LhaL a fleld ln a
Lable wlll onlv hold values LhaL are alreadv deflned ln anoLher fleld ln a dlfferenL (or
Lhe same) Lable. 1haL fleld ls Lhe candldaLe kev (usuallv a prlmarv kev of Lhe oLher
Lable).

1he oLher opLlon ls Lhe use of Lrlaaers. 1rlaaers can be used Lo ensure Lhe same effecL
of consLralnLs ln a roundabouL wav, buL lL ls much more dlfflculL Lo seL up and
malnLaln, and Lhe performance ls Lvplcallv worse. 8ecause of Lhls, MlcrosofL
recommends LhaL developers use forelan kev consLralnLs lnsLead of Lrlaaers for
malnLalnlna referenLlal lnLearlLv.

What |s a performance cons|derat|on of hav|ng too many |ndexes on a product|on
on||ne transact|on process|ng (CL1) tab|e?
?ou are looklna for Lhe appllcanL Lo make some reference reaardlna daLa
manlpulaLlons. 1he more lndexes on a Lable, Lhe more Llme lL Lakes for Lhe daLabase
enalne Lo updaLe, lnserL, or deleLe daLa, as Lhe lndexes all have Lo be malnLalned as
Lhe daLa manlpulaLlon occurs.

What can be used to ensure that a f|e|d |n a tab|e on|y accepts a certa|n range of
va|ues?
1hls quesLlon can be answered a couple of dlfferenL wavs, buL onlv one answer ls a
"aood" one. 1he answer vou wanL Lo hear ls a Check consLralnL, whlch ls deflned on a
daLabase Lable LhaL llmlLs Lhe values enLered lnLo LhaL column. 1hese consLralnLs are
relaLlvelv easv Lo creaLe, and Lhev are Lhe recommended Lvpe for enforclna domaln
lnLearlLv ln SCL Server.

1rlaaers can also be used Lo resLrlcL Lhe values accepLed ln a fleld ln a daLabase Lable,
buL Lhls soluLlon requlres Lhe Lrlaaer Lo be deflned on Lhe Lable, whlch can hlnder
performance ln cerLaln slLuaLlons. lor Lhls reason, MlcrosofL recommends Check
consLralnLs over all oLher meLhods for resLrlcLlna domaln lnLearlLv.

What |s the d|fference between a return parameter and an CU1U1 parameter?
lf Lhe appllcanL ls able Lo answer Lhls quesLlon correcLlv, Lhe odds are aood LhaL Lhev
have some experlence worklna wlLh sLored procedures.
A reLurn parameLer ls alwavs reLurned bv a sLored procedure, and lL ls meanL Lo
lndlcaLe Lhe success or fallure of Lhe sLored procedure. 1he reLurn parameLer ls
alwavs an ln1 daLa Lvpe.
An Cu1u1 parameLer ls deslanaLed speclflcallv bv Lhe developer, and lL can reLurn
oLher Lvpes of daLa, such as characLers and numerlc values. (1here are some
llmlLaLlons on Lhe daLa Lvpes LhaL can be used as ouLpuL parameLers.) ?ou can use
mulLlple Cu1u1 parameLers ln a sLored procedure, whereas vou can onlv use one
reLurn parameLer.

What |s a corre|ated sub-query? now can these quer|es be usefu|?
1he more seasoned developer wlll be able Lo accuraLelv descrlbe Lhls Lvpe of querv. A
correlaLed sub-querv ls a speclal Lvpe of querv conLalnlna a sub-querv. 1he sub-querv
conLalned ln Lhe querv acLuallv requesLs values from Lhe ouLslde querv, creaLlna a
slLuaLlon slmllar Lo a loop. ?ou can flnd a more deLalled descrlpLlon as Lo how Lhese
speclal Lvpes of querles work ln Lhls arLlcle.

You might also like