<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3842644106145230578</id><updated>2012-02-20T12:41:38.152-07:00</updated><category term='Transact-SQL'/><category term='Microsoft'/><category term='SA Login Disabled'/><category term='Website'/><category term='SQL 2008'/><category term='SQL Server 2008'/><category term='SQL'/><category term='Certification'/><category term='Select (SQL)'/><category term='SQL Server Replication'/><category term='Software versioning'/><category term='SQL Server Integration Services'/><category term='SQL Server'/><category term='SQL 2008 R2 RTM'/><category term='T-SQL Variables'/><category term='SQL Server 2005'/><category term='Windows Server 2008'/><category term='Microsoft SQL Server'/><category term='Programming'/><category term='Temp Table Clean up'/><category term='Dataflow'/><category term='Microsoft SQL Server 2008'/><category term='Database Administration'/><category term='SQL Server Partitioning'/><category term='SQL Server Reporting Services'/><category term='Backup'/><category term='Database'/><category term='Service pack'/><category term='Full text search'/><category term='FAQs  Help  and Tutorials'/><category term='SQL Server 2008 BOL'/><category term='SQL Server 2008 R2'/><category term='MSDB'/><category term='Replication Error'/><category term='Suspect_Pages'/><category term='Microsoft Developer Network'/><title type='text'>Mile High DBA</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>33</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-5403558524102935521</id><published>2012-02-20T12:34:00.005-07:00</published><updated>2012-02-20T12:41:38.167-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Database Administration'/><category scheme='http://www.blogger.com/atom/ns#' term='Backup'/><title type='text'>Compressing SQL Server Backup Files</title><content type='html'>&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;o:officedocumentsettings&gt;   &lt;o:allowpng/&gt;  &lt;/o:OfficeDocumentSettings&gt; &lt;/xml&gt;&lt;![endif][if gte mso 9]&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view&gt;Normal&lt;/w:View&gt;   &lt;w:zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:trackmoves/&gt;   &lt;w:trackformatting/&gt;   &lt;w:punctuationkerning/&gt;   &lt;w:validateagainstschemas/&gt;   &lt;w:saveifxmlinvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:ignoremixedcontent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:alwaysshowplaceholdertext&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:donotpromoteqf/&gt;   &lt;w:lidthemeother&gt;EN-US&lt;/w:LidThemeOther&gt;   &lt;w:lidthemeasian&gt;X-NONE&lt;/w:LidThemeAsian&gt;   &lt;w:lidthemecomplexscript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;   &lt;w:compatibility&gt;    &lt;w:breakwrappedtables/&gt;    &lt;w:snaptogridincell/&gt;    &lt;w:wraptextwithpunct/&gt;    &lt;w:useasianbreakrules/&gt;    &lt;w:dontgrowautofit/&gt;    &lt;w:splitpgbreakandparamark/&gt;    &lt;w:enableopentypekerning/&gt;    &lt;w:dontflipmirrorindents/&gt;    &lt;w:overridetablestylehps/&gt;   &lt;/w:Compatibility&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val="&amp;#45;-"&gt;    &lt;m:smallfrac val="off"&gt;    &lt;m:dispdef/&gt;    &lt;m:lmargin val="0"&gt;    &lt;m:rmargin val="0"&gt;    &lt;m:defjc val="centerGroup"&gt;    &lt;m:wrapindent val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&gt;   &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif][if gte mso 9]&gt;&lt;xml&gt;  &lt;w:latentstyles deflockedstate="false" defunhidewhenused="true" defsemihidden="true" defqformat="false" defpriority="99" latentstylecount="267"&gt;   &lt;w:lsdexception locked="false" priority="0" semihidden="false" unhidewhenused="false" qformat="true" name="Normal"&gt;   &lt;w:lsdexception locked="false" priority="9" semihidden="false" unhidewhenused="false" qformat="true" name="heading 1"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 2"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 3"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 4"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;w:lsdexception locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;w:lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif][if gte mso 10]&gt; &lt;style&gt;  /* Style Definitions */  table.MsoNormalTable  {mso-style-name:"Table Normal";  mso-tstyle-rowband-size:0;  mso-tstyle-colband-size:0;  mso-style-noshow:yes;  mso-style-priority:99;  mso-style-parent:"";  mso-padding-alt:0in 5.4pt 0in 5.4pt;  mso-para-margin-top:0in;  mso-para-margin-right:0in;  mso-para-margin-bottom:10.0pt;  mso-para-margin-left:0in;  line-height:115%;  mso-pagination:widow-orphan;  font-size:11.0pt;  font-family:"Calibri","sans-serif";  mso-ascii-font-family:Calibri;  mso-ascii-theme-font:minor-latin;  mso-hansi-font-family:Calibri;  mso-hansi-theme-font:minor-latin;  mso-bidi-font-family:"Times New Roman";  mso-bidi-theme-font:minor-bidi;} &lt;/style&gt; &lt;![endif]--&gt;Hello Database Professionals,&lt;br /&gt;&lt;br /&gt;Starting with SQL Server 2008 Enterprise Edition we have the option of compressing backup files (this includes both BACKUP DATABASE and BACKUP LOG statements which mean not only database backups but log file backups will be compressed) to save disk space and also decrease the duration of the backup and restore operations. &lt;span style="mso-spacerun:yes"&gt; &lt;/span&gt;The backup compression was an enterprise edition only feature with SQL Server 2008 but with SQL Server 2008 R2 this feature is supported by standard and higher editions.&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;So that was welcome news for me since I support number of SQL Server 2008 R2 Standard Edition.&lt;p class="MsoNormal"&gt;&lt;span style="mso-tab-count:1"&gt;                &lt;/span&gt;I have been using T-SQL script to backup databases.&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;The script checks the edition of the SQL Server and then builds the backup command to compress the backup file if it’s enterprise edition or just backups the database if it was a standard edition.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-tab-count:1"&gt;                &lt;/span&gt;Before the end of 2011 I have completed deploying/upgrading to SQL Server 2008 R2.&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;That meant that my script no longer needed to check the edition of SQL Server 2008 R2 since the compression is already supported in standard and higher editions.&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;So I turned to global configurations and enable the backup compressions.&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;I would like to remind the readers that enabling the backup compression creates additional CPU overhead which depends on you workload might impact your server performance.&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;I suggest that you test your backup process and if necessary using Resource Governor (this is Enterprise Edition only feature) create a low priority compressed backup in a session whose CPU usage is limited by Resource Governor when CPU contention occurs.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-tab-count:1"&gt;                &lt;/span&gt;Let’s start with checking the backup compression setting for the server by using the script below.&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue;mso-no-proof:yes"&gt;USE&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes"&gt; &lt;span style="color:blue"&gt;master&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue;mso-no-proof:yes"&gt;SELECT&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes"&gt;&lt;span style="mso-tab-count:1"&gt;      &lt;/span&gt;&lt;span style="color:gray"&gt;*&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue;mso-no-proof:yes"&gt;FROM&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes"&gt;&lt;span style="mso-tab-count:1"&gt;  &lt;/span&gt;&lt;span style="color:green"&gt;sys&lt;/span&gt;&lt;span style="color:gray"&gt;.&lt;/span&gt;&lt;span style="color:green"&gt;configurations&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue;mso-no-proof:yes"&gt;WHERE&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes"&gt;&lt;span style="mso-tab-count:1"&gt; &lt;/span&gt;name &lt;span style="color:gray"&gt;=&lt;/span&gt; &lt;span style="color:red"&gt;'backup compression default'&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;line-height:115%;font-family: &amp;quot;Courier New&amp;quot;;color:blue;mso-no-proof:yes"&gt;ORDER&lt;/span&gt;&lt;span style="font-size: 10.0pt;line-height:115%;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes"&gt; &lt;span style="color:blue"&gt;BY&lt;/span&gt; name&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font: minor-latin;mso-no-proof:yes"&gt;&lt;span style="mso-tab-count:1"&gt;                &lt;/span&gt;Let’s check the returned result for the value_in_use column.&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;This shows us the running value curently in effect for this option and is_dynamic column tells us the changes take effect after the RECONFIGURE statement executed.&lt;/span&gt;&lt;span style="mso-bidi-font-family: Calibri;mso-bidi-theme-font:minor-latin"&gt; Now it’s time to execute the below script to enable the backup compression since the value_in_use is 0 for the server I am currently working.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue;mso-no-proof:yes"&gt;USE&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes"&gt; &lt;span style="color:blue"&gt;master&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue;mso-no-proof:yes"&gt;EXEC&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes"&gt; &lt;span style="color:maroon"&gt;SP_CONFIGURE&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;'backup compression default'&lt;/span&gt;&lt;span style="color:gray"&gt;,&lt;/span&gt;1&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;line-height:115%;font-family: &amp;quot;Courier New&amp;quot;;color:blue;mso-no-proof:yes"&gt;RECONFIGURE&lt;/span&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;color:blue; mso-no-proof:yes"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font: minor-latin;color:blue;mso-no-proof:yes"&gt;&lt;span style="mso-tab-count:1"&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;mso-no-proof: yes"&gt;Let’s check the value_in_use by executing the first select statement.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue;mso-no-proof:yes"&gt;USE&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes"&gt; &lt;span style="color:blue"&gt;master&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue;mso-no-proof:yes"&gt;SELECT&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes"&gt;&lt;span style="mso-tab-count:1"&gt;      &lt;/span&gt;&lt;span style="color:gray"&gt;*&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom:0in;margin-bottom:.0001pt;line-height: normal;mso-layout-grid-align:none;text-autospace:none"&gt;&lt;span style="font-size: 10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue;mso-no-proof:yes"&gt;FROM&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes"&gt;&lt;span style="mso-tab-count:1"&gt;  &lt;/span&gt;&lt;span style="color:green"&gt;sys&lt;/span&gt;&lt;span style="color:gray"&gt;.&lt;/span&gt;&lt;span style="color:green"&gt;configurations&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size:10.0pt;line-height:115%;font-family: &amp;quot;Courier New&amp;quot;;color:blue;mso-no-proof:yes"&gt;WHERE&lt;/span&gt;&lt;span style="font-size: 10.0pt;line-height:115%;font-family:&amp;quot;Courier New&amp;quot;;mso-no-proof:yes"&gt;&lt;span style="mso-tab-count:1"&gt; &lt;/span&gt;name &lt;span style="color:gray"&gt;=&lt;/span&gt; &lt;span style="color:red"&gt;'backup compression default'&lt;/span&gt;&lt;/span&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;color:red; mso-no-proof:yes"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font: minor-latin;mso-no-proof:yes"&gt;&lt;span style="mso-tab-count:1"&gt;                &lt;/span&gt;Now we should see that the value_in_use is 1 and we don’t need to use the optional keyword COMPRESSION in the backup database command.&lt;span style="color:blue"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font: minor-latin;mso-no-proof:yes"&gt;&lt;span style="mso-tab-count:1"&gt;                &lt;/span&gt;By default when backup is compressed checksums are performed to detect media corruptions but if for any reason you need, you can explicitly disable the compression by using NO_COMPRESSION keyword in your backup statement.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font: minor-latin;mso-no-proof:yes"&gt;&lt;span style="mso-tab-count:1"&gt;                &lt;/span&gt;I have seen anywhere from 35% to 80% compression ration and backup duration decrease from several hours to 30-45 minutes for the databases I administor.&lt;span style="mso-spacerun:yes"&gt;  &lt;/span&gt;Your mileage will vary and you should TEST, TEST, TEST and deploy your changes for your environments.  Here is the &lt;a href="http://msdn.microsoft.com/en-us/library/ms186865.aspx"&gt;link&lt;/a&gt; to find out more about backup database command in MSDN.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font: minor-latin;mso-no-proof:yes"&gt;HTH,&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="mso-bidi-font-family:Calibri;mso-bidi-theme-font: minor-latin;mso-no-proof:yes"&gt;Bulent&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-5403558524102935521?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/5403558524102935521/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2012/02/compressing-sql-server-backup-files.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/5403558524102935521'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/5403558524102935521'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2012/02/compressing-sql-server-backup-files.html' title='Compressing SQL Server Backup Files'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-6154466811486320750</id><published>2012-02-03T17:30:00.003-07:00</published><updated>2012-02-03T17:32:13.852-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Database Administration'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft SQL Server 2008'/><title type='text'>Dropping Multiple SQL Server Objects in Single Line</title><content type='html'>&lt;p&gt;As humans we try to find a way to work faster and efficient.  As data  professionals, typing less probably is another thing we want.  My SQL  Server tip today is about dropping multiple objects (tables, views,  stored procedures, and even databases) in single drop statement.  This  is powerful but can be dangerous in production so please use caution.   Here is a script that creates couple of tables and then drops both  tables in single drop statement.&lt;/p&gt;  &lt;p&gt;Sincerely,&lt;/p&gt;  &lt;p&gt;Bulent&lt;/p&gt;  &lt;p&gt;-- CREATE TABLES&lt;/p&gt;  &lt;p&gt;USE tempdb&lt;/p&gt;  &lt;p&gt;GO&lt;/p&gt;  &lt;p&gt;CREATE TABLE dbo.TableT1 (t1c1 TINYINT)&lt;/p&gt;  &lt;p&gt;CREATE TABLE dbo.TableT2 (t2c1 TINYINT)&lt;/p&gt;  &lt;p&gt;GO&lt;/p&gt;  &lt;p&gt;INSERT INTO dbo.TableT1 VALUES(1)&lt;/p&gt;  &lt;p&gt;INSERT INTO dbo.TableT2 VALUES(2)&lt;/p&gt;  &lt;p&gt;GO&lt;/p&gt;  &lt;p&gt;-- CHECK THE TABLES CREATED&lt;/p&gt;  &lt;p&gt;SELECT  *&lt;/p&gt;  &lt;p&gt;FROM    sys.tables&lt;/p&gt;  &lt;p&gt;WHERE   name LIKE 'TableT_'&lt;/p&gt;  &lt;p&gt;GO&lt;/p&gt;  &lt;p&gt;-- DROP BOTH TABLES IN SINGLE DROP STATEMENT&lt;/p&gt;  &lt;p&gt;DROP TABLE dbo.TableT1, dbo.TableT2&lt;/p&gt;  &lt;p&gt;GO&lt;/p&gt;  &lt;p&gt;-- CHECK THE TABLES DROPPED&lt;/p&gt;  &lt;p&gt;SELECT  *&lt;/p&gt;  &lt;p&gt;FROM    sys.tables&lt;/p&gt;  &lt;p&gt;WHERE   name LIKE 'TableT_'&lt;/p&gt;  &lt;p&gt;GO&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-6154466811486320750?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/6154466811486320750/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2012/02/dropping-multiple-sql-server-objects-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/6154466811486320750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/6154466811486320750'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2012/02/dropping-multiple-sql-server-objects-in.html' title='Dropping Multiple SQL Server Objects in Single Line'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-7592755277239226961</id><published>2012-01-27T13:50:00.006-07:00</published><updated>2012-01-27T14:17:19.964-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Transact-SQL'/><category scheme='http://www.blogger.com/atom/ns#' term='MSDB'/><category scheme='http://www.blogger.com/atom/ns#' term='Database Administration'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft SQL Server 2008'/><title type='text'>Cycling SQL Server Error Log</title><content type='html'>I have a daily check list that I go through everyday.   And checking the SQL Server error log is one item on the list.  Depends on how your server is configured SQL Server logs informational and error messages to the log file.  By default your server is configured to have 6 log files that it keeps and when the SQL Server Service starts it removes the oldest log file.  In the meantime if your server is up for a long time the information in that log file just keeps growing and makes the log file hard to open from remote workstation.&lt;br /&gt;&lt;br /&gt;In the environments that I support I change the configuration so that I keep more than 6 files.  I set up to store 99 files (which is the max allowed files for the SQL Server error log).  Then I create a job that runs every night right after midnight.  This way when I come in every morning there is a brand new log file and since the daily log files are much smaller it makes the file easy to open and check.  I use the script below to change the number of log files (note you can do this using SSMS GUI and just make a right click on SQL Server Logs under Management folder than click on Configure and change the value to what you need).  After the change using second script I create SQL Server Agent Job that is scheduled to run right after midnight to cycle the error log.  This make the daily task of checking the error logs easier (at least for me).  Use the scripts below in a test environment and once you find out it could add some value to your daily tasks you could use it in your production environment.&lt;br /&gt;&lt;br /&gt;HTH,&lt;br /&gt;Bulent&lt;br /&gt;&lt;br /&gt;Script 1:&lt;br /&gt;This changes the number of log files stored to a value you set at the end and uses extended stored procedure to update the registry.  Remember this can be done through GUI but it does executed the same in the background.&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;USE&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt; [master]&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;GO&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;EXEC&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt; &lt;span style="color:maroon"&gt;xp_instance_regwrite&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:red"&gt;N'HKEY_LOCAL_MACHINE'&lt;/span&gt;&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;span style="color:red"&gt;N'Software\Microsoft\&lt;wbr&gt;MSSQLServer\MSSQLServer'&lt;/span&gt;&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;span style="color:red"&gt;N'NumErrorLogs'&lt;/span&gt;&lt;span style="color:gray"&gt;,&lt;/span&gt; REG_DWORD&lt;span style="color:gray"&gt;,&lt;/span&gt; 60&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Script 2:&lt;br /&gt;This script creates a job (make sure you sql server agent is running) and schedules it to run at 12:00:01 am everyday.&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;USE&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt; [msdb]&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;GO&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:green"&gt;/****** Object:  Job [A DBA SQL Server Error Log Cycle]    Script Date: 01/27/2012 14:01:38 ******/&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;BEGIN&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt; &lt;span style="color:blue"&gt;TRANSACTION&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;DECLARE&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt; @ReturnCode &lt;span style="color:blue"&gt;INT&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;SELECT&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt; @ReturnCode &lt;span style="color:gray"&gt;=&lt;/span&gt; 0&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:green"&gt;/****** Object:  JobCategory [Database Maintenance]    Script Date: 01/27/2012 14:01:38 ******/&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;IF&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt; &lt;span style="color:gray"&gt;NOT&lt;/span&gt; &lt;span style="color:gray"&gt;EXISTS&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;&lt;span style="color:gray"&gt;(&lt;/span&gt;&lt;span style="color:blue"&gt;SELECT&lt;/span&gt; name &lt;span style="color:blue"&gt;FROM&lt;/span&gt; msdb&lt;span style="color:gray"&gt;.&lt;/span&gt;dbo&lt;span style="color:gray"&gt;.&lt;/span&gt;syscategories &lt;span style="color:blue"&gt;WHERE&lt;/span&gt; name&lt;span style="color:gray"&gt;=&lt;/span&gt;&lt;span style="color:red"&gt;N'Database Maintenance'&lt;/span&gt; &lt;span style="color:gray"&gt;AND&lt;/span&gt; category_class&lt;span style="color:gray"&gt;=&lt;/span&gt;1&lt;span style="color:gray"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;EXEC&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt; @ReturnCode &lt;span style="color:gray"&gt;=&lt;/span&gt; msdb&lt;span style="color:gray"&gt;.&lt;/span&gt;dbo&lt;span style="color:gray"&gt;.&lt;/span&gt;&lt;span style="color:maroon"&gt;sp_add_category&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;@class&lt;span style="color:gray"&gt;=&lt;/span&gt;&lt;span style="color:red"&gt;N'JOB'&lt;/span&gt;&lt;span style="color:gray"&gt;,&lt;/span&gt; @type&lt;span style="color:gray"&gt;=&lt;/span&gt;&lt;span style="color:red"&gt;N'LOCAL'&lt;/span&gt;&lt;span style="color:gray"&gt;,&lt;/span&gt; @name&lt;span style="color:gray"&gt;=&lt;/span&gt;&lt;span style="color:red"&gt;N'Database Maintenance'&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;IF &lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:gray"&gt;(&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:fuchsia"&gt;@@ERROR&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt; &lt;span style="color:gray"&gt;&amp;lt;&amp;gt;&lt;/span&gt; 0 &lt;span style="color:gray"&gt;OR&lt;/span&gt; @ReturnCode &lt;span style="color:gray"&gt;&amp;lt;&amp;gt;&lt;/span&gt; 0&lt;span style="color:gray"&gt;)&lt;/span&gt; &lt;span style="color:blue"&gt;GOTO&lt;/span&gt; QuitWithRollback&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;END&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;DECLARE&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt; @jobId &lt;span style="color:blue"&gt;BINARY&lt;/span&gt;&lt;span style="color:gray"&gt;(&lt;/span&gt;16&lt;span style="color:gray"&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;EXEC&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt; @ReturnCode &lt;span style="color:gray"&gt;=&lt;/span&gt;  msdb&lt;span style="color:gray"&gt;.&lt;/span&gt;dbo&lt;span style="color:gray"&gt;.&lt;/span&gt;&lt;span style="color:maroon"&gt;sp_add_job&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;@job_name&lt;span style="color:gray"&gt;=&lt;/span&gt;&lt;span style="color:red"&gt;N'A DBA SQL Server Error Log Cycle'&lt;/span&gt;&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @enabled&lt;span style="color:gray"&gt;=&lt;/span&gt;1&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @notify_level_eventlog&lt;span style="color:gray"&gt;=&lt;/span&gt;2&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @notify_level_email&lt;span style="color:gray"&gt;=&lt;/span&gt;0&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @notify_level_netsend&lt;span style="color:gray"&gt;=&lt;/span&gt;0&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @notify_level_page&lt;span style="color:gray"&gt;=&lt;/span&gt;0&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @delete_level&lt;span style="color:gray"&gt;=&lt;/span&gt;0&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @description&lt;span style="color:gray"&gt;=&lt;/span&gt;&lt;span style="color:red"&gt;N'Cycle sql serve error log and create a new error log file'&lt;/span&gt;&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @category_name&lt;span style="color:gray"&gt;=&lt;/span&gt;&lt;span style="color:red"&gt;N'Database Maintenance'&lt;/span&gt;&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @owner_login_name&lt;span style="color:gray"&gt;=&lt;/span&gt;&lt;span style="color:red"&gt;N'sa'&lt;/span&gt;&lt;span style="color:gray"&gt;,&lt;/span&gt; @job_id &lt;span style="color:gray"&gt;=&lt;/span&gt; @jobId &lt;span style="color:blue"&gt;OUTPUT&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;IF &lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:gray"&gt;(&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:fuchsia"&gt;@@ERROR&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt; &lt;span style="color:gray"&gt;&amp;lt;&amp;gt;&lt;/span&gt; 0 &lt;span style="color:gray"&gt;OR&lt;/span&gt; @ReturnCode &lt;span style="color:gray"&gt;&amp;lt;&amp;gt;&lt;/span&gt; 0&lt;span style="color:gray"&gt;)&lt;/span&gt; &lt;span style="color:blue"&gt;GOTO&lt;/span&gt; QuitWithRollback&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:green"&gt;/****** Object:  Step [Cycle Error Log]    Script Date: 01/27/2012 14:01:38 ******/&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;EXEC&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt; @ReturnCode &lt;span style="color:gray"&gt;=&lt;/span&gt; msdb&lt;span style="color:gray"&gt;.&lt;/span&gt;dbo&lt;span style="color:gray"&gt;.&lt;/span&gt;&lt;span style="color:maroon"&gt;sp_add_jobstep&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;@job_id&lt;span style="color:gray"&gt;=&lt;/span&gt;@jobId&lt;span style="color:gray"&gt;,&lt;/span&gt; @step_name&lt;span style="color:gray"&gt;=&lt;/span&gt;&lt;span style="color:red"&gt;N'Cycle Error Log'&lt;/span&gt;&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @step_id&lt;span style="color:gray"&gt;=&lt;/span&gt;1&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @cmdexec_success_code&lt;span style="color:gray"&gt;=&lt;/span&gt;0&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @on_success_action&lt;span style="color:gray"&gt;=&lt;/span&gt;1&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @on_success_step_id&lt;span style="color:gray"&gt;=&lt;/span&gt;0&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @on_fail_action&lt;span style="color:gray"&gt;=&lt;/span&gt;2&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @on_fail_step_id&lt;span style="color:gray"&gt;=&lt;/span&gt;0&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @retry_attempts&lt;span style="color:gray"&gt;=&lt;/span&gt;0&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @retry_interval&lt;span style="color:gray"&gt;=&lt;/span&gt;0&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @os_run_priority&lt;span style="color:gray"&gt;=&lt;/span&gt;0&lt;span style="color:gray"&gt;,&lt;/span&gt; @subsystem&lt;span style="color:gray"&gt;=&lt;/span&gt;&lt;span style="color:red"&gt;N'TSQL'&lt;/span&gt;&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @command&lt;span style="color:gray"&gt;=&lt;/span&gt;&lt;span style="color:red"&gt;N'EXEC sp_cycle_errorlog ;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:red"&gt;'&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:gray"&gt;,&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @database_name&lt;span style="color:gray"&gt;=&lt;/span&gt;&lt;span style="color:red"&gt;N'master'&lt;/span&gt;&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @flags&lt;span style="color:gray"&gt;=&lt;/span&gt;0&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;IF &lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:gray"&gt;(&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:fuchsia"&gt;@@ERROR&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt; &lt;span style="color:gray"&gt;&amp;lt;&amp;gt;&lt;/span&gt; 0 &lt;span style="color:gray"&gt;OR&lt;/span&gt; @ReturnCode &lt;span style="color:gray"&gt;&amp;lt;&amp;gt;&lt;/span&gt; 0&lt;span style="color:gray"&gt;)&lt;/span&gt; &lt;span style="color:blue"&gt;GOTO&lt;/span&gt; QuitWithRollback&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;EXEC&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt; @ReturnCode &lt;span style="color:gray"&gt;=&lt;/span&gt; msdb&lt;span style="color:gray"&gt;.&lt;/span&gt;dbo&lt;span style="color:gray"&gt;.&lt;/span&gt;&lt;span style="color:maroon"&gt;sp_update_job&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;@job_id &lt;span style="color:gray"&gt;=&lt;/span&gt; @jobId&lt;span style="color:gray"&gt;,&lt;/span&gt; @start_step_id &lt;span style="color:gray"&gt;=&lt;/span&gt; 1&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;IF &lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:gray"&gt;(&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:fuchsia"&gt;@@ERROR&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt; &lt;span style="color:gray"&gt;&amp;lt;&amp;gt;&lt;/span&gt; 0 &lt;span style="color:gray"&gt;OR&lt;/span&gt; @ReturnCode &lt;span style="color:gray"&gt;&amp;lt;&amp;gt;&lt;/span&gt; 0&lt;span style="color:gray"&gt;)&lt;/span&gt; &lt;span style="color:blue"&gt;GOTO&lt;/span&gt; QuitWithRollback&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;EXEC&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt; @ReturnCode &lt;span style="color:gray"&gt;=&lt;/span&gt; msdb&lt;span style="color:gray"&gt;.&lt;/span&gt;dbo&lt;span style="color:gray"&gt;.&lt;/span&gt;&lt;span style="color:maroon"&gt;sp_add_jobschedule&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;@job_id&lt;span style="color:gray"&gt;=&lt;/span&gt;@jobId&lt;span style="color:gray"&gt;,&lt;/span&gt; @name&lt;span style="color:gray"&gt;=&lt;/span&gt;&lt;span style="color:red"&gt;N'Cycle Error Log'&lt;/span&gt;&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @enabled&lt;span style="color:gray"&gt;=&lt;/span&gt;1&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @freq_type&lt;span style="color:gray"&gt;=&lt;/span&gt;4&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @freq_interval&lt;span style="color:gray"&gt;=&lt;/span&gt;1&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @freq_subday_type&lt;span style="color:gray"&gt;=&lt;/span&gt;1&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @freq_subday_interval&lt;span style="color:gray"&gt;=&lt;/span&gt;0&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @freq_relative_interval&lt;span style="color:gray"&gt;=&lt;/span&gt;0&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @freq_recurrence_factor&lt;span style="color:gray"&gt;=&lt;/span&gt;0&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @active_start_date&lt;span style="color:gray"&gt;=&lt;/span&gt;20111013&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @active_end_date&lt;span style="color:gray"&gt;=&lt;/span&gt;99991231&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @active_start_time&lt;span style="color:gray"&gt;=&lt;/span&gt;1&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @active_end_time&lt;span style="color:gray"&gt;=&lt;/span&gt;235959&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;            @schedule_uid&lt;span style="color:gray"&gt;=&lt;/span&gt;&lt;span style="color:red"&gt;N'b029ce7b-80f1-&lt;wbr&gt;47ad-981a-1fa90edfe302'&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;IF &lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:gray"&gt;(&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:fuchsia"&gt;@@ERROR&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt; &lt;span style="color:gray"&gt;&amp;lt;&amp;gt;&lt;/span&gt; 0 &lt;span style="color:gray"&gt;OR&lt;/span&gt; @ReturnCode &lt;span style="color:gray"&gt;&amp;lt;&amp;gt;&lt;/span&gt; 0&lt;span style="color:gray"&gt;)&lt;/span&gt; &lt;span style="color:blue"&gt;GOTO&lt;/span&gt; QuitWithRollback&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;EXEC&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt; @ReturnCode &lt;span style="color:gray"&gt;=&lt;/span&gt; msdb&lt;span style="color:gray"&gt;.&lt;/span&gt;dbo&lt;span style="color:gray"&gt;.&lt;/span&gt;&lt;span style="color:maroon"&gt;sp_add_jobserver&lt;/span&gt;&lt;span style="color:blue"&gt; &lt;/span&gt;@job_id &lt;span style="color:gray"&gt;=&lt;/span&gt; @jobId&lt;span style="color:gray"&gt;,&lt;/span&gt; @server_name &lt;span style="color:gray"&gt;=&lt;/span&gt; &lt;span style="color:red"&gt;N'(local)'&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;IF &lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:gray"&gt;(&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:fuchsia"&gt;@@ERROR&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt; &lt;span style="color:gray"&gt;&amp;lt;&amp;gt;&lt;/span&gt; 0 &lt;span style="color:gray"&gt;OR&lt;/span&gt; @ReturnCode &lt;span style="color:gray"&gt;&amp;lt;&amp;gt;&lt;/span&gt; 0&lt;span style="color:gray"&gt;)&lt;/span&gt; &lt;span style="color:blue"&gt;GOTO&lt;/span&gt; QuitWithRollback&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;COMMIT&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt; &lt;span style="color:blue"&gt;TRANSACTION&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;GOTO&lt;/span&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt; EndSave&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;QuitWithRollback:&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;"&gt;    &lt;span style="color:blue"&gt;IF &lt;/span&gt;&lt;span style="color:gray"&gt;(&lt;/span&gt;&lt;span style="color:fuchsia"&gt;@@TRANCOUNT&lt;/span&gt; &lt;span style="color:gray"&gt;&amp;gt;&lt;/span&gt; 0&lt;span style="color:gray"&gt;)&lt;/span&gt; &lt;span style="color:blue"&gt;ROLLBACK&lt;/span&gt; &lt;span style="color:blue"&gt;TRANSACTION&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;EndSave:&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-autospace:none"&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt; &lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:10.0pt;font-family:&amp;quot;Courier New&amp;quot;;color:blue"&gt;GO&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-7592755277239226961?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/7592755277239226961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2012/01/cycling-sql-server-error-log.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/7592755277239226961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/7592755277239226961'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2012/01/cycling-sql-server-error-log.html' title='Cycling SQL Server Error Log'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-4769453900969682065</id><published>2012-01-20T12:44:00.022-07:00</published><updated>2012-01-20T13:16:54.836-07:00</updated><title type='text'>SSRS 2008 Transport Error Code 0x800ccc15</title><content type='html'>Hello all,&lt;br /&gt;&lt;br /&gt;I received and email stating that a user did not receive the report from SSRS that he was subscribed to in the last couple of days.  When I start looking into the report in the subscription tab of the report I saw the message below.&lt;br /&gt;&lt;br /&gt;Failure sending mail: The message could not be sent to the SMTP server. The transport error code was 0x800ccc15. The server response was not available&lt;br /&gt;&lt;br /&gt;I tried to open the report and had no problem running the report manually.  Then I update the schedule of the report to see if the scheduled sql server agent job is updated as well.  Then I looked at the jobs in the server hosting ReportServer database and found the corresponding job with that timed subscription and verified that the execution time of the job is updated with what I did using SSRS portal (In the SQL Server Agent Jobs the name of the jobs for SSRS are given using a system generated GUID and if you don't know the job it's hard to locate since there may be many of them, in my case there were only 8 jobs and I knew which job I need to check once I made the change.  However in future blog I will post about this in little more detail).  I waited for couple of minutes and saw that the job executed in SQL Server Agent hosting ReportServer database.  However still saw the same error message.&lt;br /&gt;&lt;br /&gt;I remote into the SSRS server to look into to the problem locally.  As soon as I logged in I saw a red icon on the task bar coming from McAfee.  I remember that I had to change the configuration of the McAfee to allow database mail to work couple weeks ago.  I opened the log and found that the log event below.&lt;br /&gt;1/19/2012    2:30:30 PM    Blocked by port blocking rule     C:\Program Files\Microsoft SQL Server\MSRS10_50.MSSQLSERVER\Reporting Services\ReportServer\bin\ReportingServicesService.exe    Anti-virus Standard Protection:Prevent mass mailing worms from sending mail    192.168.162.162:250&lt;br /&gt;&lt;br /&gt;That is when I knew what was wrong.  The McAfee ePO policy change forced to server so that processes that need to send email has to be excluded in the Prevent Mass Mailing Worms section.  I talked to sysadmin who administers the ePO policy to exclude the ReportingServicesService.exe and push the policy again to the server.  Within a minute policy was in effect.  I update the report subscription to 3 minutes later and waited for the mail to arrive with the report attached.  After 3 minutes voila, I received the email and solved the problem.  In my case it was as simple as adding the process to exclusion list to send SMTP emails.&lt;br /&gt;&lt;br /&gt;HTH,&lt;br /&gt;Bulent&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-4769453900969682065?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/4769453900969682065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2012/01/ssrs-2008-transport-error-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/4769453900969682065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/4769453900969682065'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2012/01/ssrs-2008-transport-error-code.html' title='SSRS 2008 Transport Error Code 0x800ccc15'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-3101144826736025978</id><published>2012-01-12T17:30:00.003-07:00</published><updated>2012-01-12T17:33:35.114-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><category scheme='http://www.blogger.com/atom/ns#' term='Backup'/><title type='text'>SQL Function QUOTENAME()</title><content type='html'>&lt;div&gt;Hello all,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I support third party software databases at work.  During the implementation of the application it needed to create a database to store the data.  However the application created a database with a name that does not follow the rules for the format of identifiers.  In my case we ended up with a database name '20120101_Survey'.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;On the same server I have a custom built script that backups up all the databases at night.  However, following the database creation my backup process failed and I got an alert about the process.  Further looking into the problem I found out that there was a problem with the syntax.  As soon as I see the statement I knew what the problem was but never thought about it while deploying the application and database.  To keep the story short I used the SQL Server function called QUOTENAME() to fix the problem.  Using the function in my custom script help me return the database names with delimiters so that backup process completes without error.  Since then I have been using the function with all the object names.  This simple function can prevent some headaches if a DBA needs to support 3rd party databases (&lt;a class="zem_slink" href="http://en.wikipedia.org/wiki/Microsoft_SharePoint" title="Microsoft SharePoint" rel="wikipedia"&gt;SharePoint&lt;/a&gt; is also a good example because the SharePoint database names don't follow the rules of the identifier format).  Here is the link to the &lt;a href="http://msdn.microsoft.com/en-us/library/ms176114.aspx"&gt;msdn&lt;/a&gt; and below is simple statement that returns all the databases in your system with delimiters.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;SELECT&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;QUOTENAME(name) AS DelimitedDbName&lt;/div&gt;&lt;div&gt;FROM&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;sys.databases&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;HTH,&lt;/div&gt;&lt;div&gt;Bulent&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;  &lt;div class="zemanta-pixie" style="margin-top:10px;height:15px"&gt;&lt;a class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"&gt;&lt;img class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=82a80539-49e9-4bf7-97e8-2972794ead70" alt="Enhanced by Zemanta" style="border:none;float:right" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-3101144826736025978?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/3101144826736025978/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2012/01/sql-function-quotename.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/3101144826736025978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/3101144826736025978'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2012/01/sql-function-quotename.html' title='SQL Function QUOTENAME()'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-1538797831329875742</id><published>2011-12-08T13:59:00.008-07:00</published><updated>2011-12-08T14:14:34.714-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Replication Error'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Replication'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft SQL Server'/><title type='text'>The distribution agent failed to create temporary files</title><content type='html'>&lt;span class="Apple-style-span"  &gt;Hello,&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;I ran into a replication error right after configuring the transactional replication.  The error started after applying the snapshot and the exact the error message was '&lt;span class="Apple-style-span" style="line-height: 16px; background-color: rgb(255, 255, 255); "&gt;The distribution agent failed to create temporary files in C:\Program Files\Microsoft SQL Server\100\COM directory. System returned errorcode 5.'  In this specific configuration I was using the sql server agent account as the distribution agent and the AD account was just a simple domain user.  In this case the culprit was that the account being used as distribution agent needed write access to folder and giving that permissions fixed the error.  One thing to remember is if this is a clustered sql server you're working with you need to grant write access to the account for all the nodes in the cluster.  Here is the &lt;a href="http://support.microsoft.com/kb/956032"&gt;link&lt;/a&gt; to MS KB article.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;&lt;span class="Apple-style-span" style="line-height: 16px; background-color: rgb(255, 255, 255); "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;&lt;span class="Apple-style-span" style="line-height: 16px; background-color: rgb(255, 255, 255); "&gt;HTH,&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;&lt;span class="Apple-style-span" style="line-height: 16px; background-color: rgb(255, 255, 255); "&gt;Bulent&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-1538797831329875742?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/1538797831329875742/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2011/12/distribution-agent-failed-to-create.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/1538797831329875742'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/1538797831329875742'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2011/12/distribution-agent-failed-to-create.html' title='The distribution agent failed to create temporary files'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-7626811803297376196</id><published>2011-09-13T12:01:00.010-06:00</published><updated>2011-09-13T12:13:36.820-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><category scheme='http://www.blogger.com/atom/ns#' term='Certification'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft SQL Server 2008'/><title type='text'>70-433 TS: Microsoft SQL Server 2008, Database Development</title><content type='html'>Another period of time just passed very quickly and no blogs I was able to post.  During that time I passed exam 70-433 TS: Microsoft SQL Server 2008, Database Development and I got another certification under my belt.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So how did I prepare for the exam?  I used this &lt;a href="http://www.amazon.com/MCTS-Self-Paced-Training-Exam-70-433/dp/0735626391/ref=sr_1_1?ie=UTF8&amp;amp;qid=1315937147&amp;amp;sr=8-1"&gt;book&lt;/a&gt; and I think it's good book that covers the exam objectives.  I have also used Transcender exam to prepare for the final week.  I have to warn that you need to know the XML Query in SQL Server.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Good luck if you're preparing for this exam.   Soon I will start preparing for 70-450: PRO: Designing, Optimizing and Maintaining a Database  Administrative Solution Using Microsoft SQL Server 2008 and if you have any tips for me please let me know.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;HTH,&lt;/div&gt;&lt;div&gt;Bulent&lt;br /&gt;&lt;div class="zemanta-pixie" style="margin-top:10px;height:15px"&gt;&lt;a class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"&gt;&lt;img class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=12845994-3499-45d0-9f72-dcd1e763c0ed" alt="Enhanced by &amp;lt;span class=" id="SPELLING_ERROR_5" /&gt;Zemanta" style="border:none;float:right"&amp;gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-7626811803297376196?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/7626811803297376196/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2011/09/70-433-ts-microsoft-sql-server-2008.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/7626811803297376196'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/7626811803297376196'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2011/09/70-433-ts-microsoft-sql-server-2008.html' title='70-433 TS: Microsoft SQL Server 2008, Database Development'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-7827682105997555652</id><published>2011-09-13T11:40:00.008-06:00</published><updated>2011-09-13T12:00:43.386-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><category scheme='http://www.blogger.com/atom/ns#' term='Full text search'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>SQL Server 2008 R2 Express Edition and Full Text Search</title><content type='html'>&lt;div&gt;Hello all,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;Couple of months ago I installed SQL Server 2008 R2 Express Edition to be used as repository for test tool the QA department needed to use.  Everything seems to be fine till end of August when QA team needed to enable Full Text Search and search for some of the databases during their test phase.  I got an email stating that the full text did not work.  So I dived in to investigate.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I found out that SQL Server 2008 R2 Express edition only does not support the full text search and I had to upgrade to SQL Server 2008 R2 Express Edition with Advanced Features.  While searching I found this &lt;a href="http://kiln.stackexchange.com/questions/1901/how-do-i-upgrade-sql-server-to-enable-full-text-search"&gt;site&lt;/a&gt; that talks about how to upgrade the Edition.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In my case the upgrade did not work.  I kept getting run time errors during the upgrade process.  That forced me to uninstall but before uninstall I backed up all the user databases and scripted out the logins using sp_help_revlogin stored procedure (you can read all about transferring logins &lt;a href="http://support.microsoft.com/kb/918992"&gt;here&lt;/a&gt;). Then I installed SQL Server 2008 R2 Express Edition with Advanced Features.  During the installation I checked the full text search in the feature selection and continue with the process.  Then I executed the script to create the logins.  After that I attached all the databases and voila.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I think from now on I will only install SQL Server 2008 R2 Express Edition with Advanced Features but install only the features I need (ie, database only) and if someone needs other features like Full Text Search or Reporting Services then I can easily add the features.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;HTH,&lt;/div&gt;&lt;div&gt;Bulent&lt;/div&gt;  &lt;div class="zemanta-pixie" style="margin-top:10px;height:15px"&gt;&lt;a class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"&gt;&lt;img class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=19d4c582-ff8c-4189-91b1-9a567780f3cf" alt="Enhanced by Zemanta" style="border:none;float:right" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-7827682105997555652?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/7827682105997555652/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2011/09/sql-server-2008-r2-express-edition-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/7827682105997555652'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/7827682105997555652'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2011/09/sql-server-2008-r2-express-edition-and.html' title='SQL Server 2008 R2 Express Edition and Full Text Search'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-2258862253735149672</id><published>2011-06-09T15:51:00.005-06:00</published><updated>2011-06-09T16:12:45.282-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Temp Table Clean up'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft SQL Server'/><title type='text'>Dropping Local Temp Table</title><content type='html'>A collegue needed to create a local temp table in his work to insert records.  When executed the script to create and insert records after first try he kept getting error message stating that 'There is already object named #TestTable in the database.  I told him that he should clean up the Temp tables at the end when he is done with them and also to be safe in the beginning of the code to check and drop if the table exists.  Here is an example.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;-- CHECK AND DROP TEMP TABLE IF EXISTS&lt;/div&gt;&lt;div&gt;IF OBJECT_ID ('Tempdb.dbo.#TestTempTable')  IS NOT NULL&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;BEGIN&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;DROP TABLE #TestTempTable&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;END&lt;/div&gt;&lt;div&gt;-- CREATE TEMP TABLE&lt;/div&gt;&lt;div&gt;CREATE TABLE #TestTempTable (&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;RowID tinyint not null,&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;City varchar(50) not null&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;)&lt;/div&gt;&lt;div&gt;-- POPULATE WITH DATA&lt;/div&gt;&lt;div&gt;INSERT INTO #TestTempTable&lt;/div&gt;&lt;div&gt;SELECT&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;1,'London'&lt;/div&gt;&lt;div&gt;UNION&lt;/div&gt;&lt;div&gt;SELECT&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;2, 'Chicago'&lt;/div&gt;&lt;div&gt;UNION&lt;/div&gt;&lt;div&gt;SELECT&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;3, 'Paris'&lt;/div&gt;&lt;div&gt;/***&lt;/div&gt;&lt;div&gt;MORE CODE HERE&lt;/div&gt;&lt;div&gt;***/&lt;/div&gt;&lt;div&gt;SELECT * FROM #TestTempTable&lt;/div&gt;&lt;div&gt;-- WHEN DONE CLEAN UP THE TEMP TABLE&lt;/div&gt;&lt;div&gt;DROP TABLE #TestTempTable&lt;/div&gt;&lt;/div&gt;  &lt;div class="zemanta-pixie" style="margin-top:10px;height:15px"&gt;&lt;a class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"&gt;&lt;img class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=4f44a3ee-7d2c-4918-b931-5876c75aaca4" alt="Enhanced by Zemanta" style="border:none;float:right" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-2258862253735149672?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/2258862253735149672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2011/06/dropping-local-temp-table.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/2258862253735149672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/2258862253735149672'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2011/06/dropping-local-temp-table.html' title='Dropping Local Temp Table'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-5094699810099854357</id><published>2011-06-08T12:44:00.006-06:00</published><updated>2011-06-09T10:53:34.169-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Reporting Services'/><title type='text'>Remove Server from SSRS Scale Out Deployment</title><content type='html'>Hello all,&lt;div&gt;I worked in a project to move the existing &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;SSRS&lt;/span&gt; report server to another server to consolidate &lt;a class="zem_slink" href="http://en.wikipedia.org/wiki/Server_%28computing%29" title="Server (computing)" rel="wikipedia"&gt;servers&lt;/a&gt;.  Both new and old report servers have been installed with &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;SQL&lt;/span&gt; Server/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;SSRS&lt;/span&gt; 2008 Enterprise. We backed up the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;reportserver&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;reportservertempdb&lt;/span&gt; and encryption keys on the old server.  Then we installed &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;SSRS&lt;/span&gt; 2008 Enterprise to new server.  Then restored the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;reportserver&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;reportservertempdb&lt;/span&gt;, encryption keys to the new server and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;vola&lt;/span&gt; we have a new &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;SSRS&lt;/span&gt; running on the new server.  It was not hard at all.  The small detail that I found out later was when I was checking report server configuration manager.  All the way at the bottom where you can configure Scale Out &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;SSRS&lt;/span&gt; &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_11"&gt;deployment&lt;/span&gt; both the new server and old server were listed.  At the time the old server were removed from production and not accessible.  To clean up the scale out deployment configuration and remove the old server we had to do the following.  Of course backup was first done for any configuration changes to our servers.&lt;/div&gt;&lt;div&gt;1. Backup the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;reportserver&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;reportservertempdb&lt;/span&gt; databases&lt;/div&gt;&lt;div&gt;2. Backup report server encryption keys&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Once we have a backup I proceeded to clean up.  Please use caution while doing this task.  We will use &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;RSKeyMgmt&lt;/span&gt;.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;exe&lt;/span&gt; in command line window.&lt;/div&gt;&lt;div&gt;1.  Open command line and go the the path C:\Program Files (x86)\Microsoft &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;SQL&lt;/span&gt; Server\100\Tools\&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;Binn&lt;/span&gt;\ (on a 64-bit &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;SQL&lt;/span&gt; 2008 Reporting Services )&lt;/div&gt;&lt;div&gt;2. List the report servers currently in the database type the command&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;RSKeyMgmt&lt;/span&gt; -l&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;You will see the server listed with their &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;GUID&lt;/span&gt;.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;Note the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;GUID&lt;/span&gt; of the server that you want to remove.&lt;/div&gt;&lt;div&gt;3. To remove the instance of the Report server type the command below.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;RSKeyMgmt&lt;/span&gt; -r GUIDoftheSSRSserverTobeRemoved&lt;/div&gt;&lt;div&gt;4. You will be prompted by a question if you're sure you want to do this.  Press Y if you're sure you want to remove the server.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;5. Type the command &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;RSKeyMgmt&lt;/span&gt; -l to list to server and verify that the server has been removed.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;HTH&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;Bulent&lt;/span&gt;&lt;/div&gt;    &lt;div class="zemanta-pixie" style="margin-top:10px;height:15px"&gt;&lt;a class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"&gt;&lt;img class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=b9f974bf-082f-44a0-8e18-5b57929def01" alt="Enhanced by &amp;lt;span class=" id="SPELLING_ERROR_26" /&gt;Zemanta" style="border:none;float:right"&amp;gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-5094699810099854357?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/5094699810099854357/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2011/06/remove-server-from-ssrs-scale-out.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/5094699810099854357'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/5094699810099854357'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2011/06/remove-server-from-ssrs-scale-out.html' title='Remove Server from SSRS Scale Out Deployment'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-357245854698471723</id><published>2011-03-26T16:10:00.007-06:00</published><updated>2011-03-26T17:00:01.926-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><category scheme='http://www.blogger.com/atom/ns#' term='Select (SQL)'/><title type='text'>More on SQL Server 2008 Variable Enhancements</title><content type='html'>Let's continue where we left last week.  I want to point out another enhancement around assigning values to parameters in SQL 2008 and above.  It's called compound assignment operator, starting with SQL 2008 we can declare a parameter and assign value and also we can do mathematical operations. &lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;div&gt;-- SQL Server 2008 and 2008 R2&lt;/div&gt;&lt;div&gt;DECLARE @DueAmount MONEY = 101&lt;/div&gt;&lt;div&gt;-- 10% off purchases over 100$ promotion&lt;/div&gt;&lt;div&gt;IF @DueAmount &gt; 100&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;BEGIN&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;SET @DueAmount *= 0.9&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;END&lt;/div&gt;&lt;div&gt;SELECT&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;@DueAmount&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;GO&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;-- SQL Server 2005 and before&lt;/div&gt;&lt;div&gt;DECLARE&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;@DueAmount MONEY&lt;/div&gt;&lt;div&gt;SELECT&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;@DueAmount = 101&lt;/div&gt;&lt;div&gt;-- 10% off purchases over 100$ promotion&lt;/div&gt;&lt;div&gt;IF @DueAmount &gt; 100&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;BEGIN&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;SET @DueAmount =  @DueAmount * 0.9&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;END&lt;/div&gt;&lt;div&gt;SELECT&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;@DueAmount&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you pay attention how the value is being set inside the if logic you will understand how compound assignments works.  Here is the &lt;a href="http://msdn.microsoft.com/en-us/library/ms189484.aspx"&gt;link&lt;/a&gt; to msdn page for more detailed info around setting the values to variables.  It does help with less coding in your T-SQL but if there is sql server 2005 or earlier versions exist in your environment be careful to remember which environments that statement will be used.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;HTH,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Bulent&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-357245854698471723?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/357245854698471723/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2011/03/more-on-sql-server-2008-variable.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/357245854698471723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/357245854698471723'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2011/03/more-on-sql-server-2008-variable.html' title='More on SQL Server 2008 Variable Enhancements'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-6867154451205095262</id><published>2011-03-20T20:17:00.005-06:00</published><updated>2011-03-20T20:38:10.132-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='T-SQL Variables'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><title type='text'>SQL Server 2008 Variable Declaration</title><content type='html'>Another day a developer approached me stating that the code works in local development server but it does not work when deployed to QA. I know that QA server is running SQL Server 2005.  I heard that lately the development team was getting new workstations with new set up.  So I was sure that they were running something other than SQL server 2005.  I asked the developer if the sql server running on the workstation was SQL 2008.  The answer was yes and I then asked how variables were declared and assigned the valued.  It was just the first thing that came to my mind.  And I was right.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So, starting with SQL Server 2008 Microsoft made improvements on declaring variables and assigning values to them.  Here is an example for SQL Server 2008 and newer versions.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;DECLARE @Startdate DATETIME = GETDATE()&lt;/div&gt;&lt;div&gt;DECLARE @AccountID INT = 12345&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;SELECT&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;@Startdate AS StartDate,&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;@AccountID AS AccountID&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However if you run the above statement in SQL 2005 or earlier you will get an error message.  The only way above statement will work on SQL 2005 and earlier versions is;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;DECLARE @Startdate DATETIME&lt;/div&gt;&lt;div&gt;DECLARE @AccountID INT&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;SELECT&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;@Startdate  = GETDATE(),&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;@AccountID = 12345&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;SELECT&lt;span class="Apple-tab-span" style="white-space: pre; "&gt; &lt;/span&gt;@Startdate AS StartDate,&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt;  &lt;/span&gt;@AccountID AS AccountID&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As you see it is less of t-sql code for SQL Server 2008 and newer versions.  There is some more enhancements but I will cover that in my next blog.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;HTH,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Bulent&lt;/div&gt;  &lt;div class="zemanta-pixie" style="margin-top:10px;height:15px"&gt;&lt;a class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"&gt;&lt;img class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=5343bc1f-e889-487f-9d58-97d0d0e61631" alt="Enhanced by Zemanta" style="border:none;float:right" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-6867154451205095262?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/6867154451205095262/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2011/03/sql-server-2008-variable-declaration.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/6867154451205095262'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/6867154451205095262'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2011/03/sql-server-2008-variable-declaration.html' title='SQL Server 2008 Variable Declaration'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-3858100129543163588</id><published>2011-03-05T20:14:00.013-07:00</published><updated>2011-03-05T20:25:13.191-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><category scheme='http://www.blogger.com/atom/ns#' term='Certification'/><title type='text'>70-432 TS: Microsoft SQL Server 2008, Implementation and Maintenance</title><content type='html'>&lt;div&gt;Hello all,&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;I have been pretty quite lately. There are many reasons for that.  One of them is I was preparing for the 70-432 exam. I see a lot of questions in the net about the preparation and books. So I wanted to blog something around that.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;Good news is I passed the exam and scored 833 out of 1000. It's not too high of a score but if you score 700 or above, you're certified.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;Now the preparation part. I have used &lt;a href="http://www.amazon.com/Self-Paced-Training-70-432-2008-Implementation-PRO-Certification/dp/0735626057"&gt;MS Press book by Mike Hotek&lt;/a&gt;. I like how each chapter is divided into lessons that are not too long to complete.  From my experience standpoint the book pretty much covers the material in the exam. The study gave me a chance to look at the features of SQL Server that I don't use day in and day out.  I have been working with SQL Server since 2005 including version 2000/2005/2008/2008 R2.  I did pass the 2000 Admin and developer certifications back in 2007.  At the time where I work we did not have anything but SQL Server 2000.  Since then a lot changed.  However I still wanted to grab a book and study.  However I do think that this book is not just enough. The questions at the end of each chapter are quite easy so it may give you a false sense of confidence (at least for me it might have been).  So I turned to practice exam by &lt;a href="http://www.transcender.com/"&gt;Transcender&lt;/a&gt;.  When I started the practice exam it was a lot tougher than the questions in the book. Transcender exam practice really helped me tune more towards the exam format.  I definitely recommend the exam practice since it also helps with the explanation of the answers for each question. I also kept the BOL (Books On Line) open.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;So one exam is down and I am trying to decide which &lt;a class="zem_slink" href="http://www.microsoft.com/sqlserver" title="Microsoft SQL Server" rel="homepage"&gt;MS SQL Server&lt;/a&gt; &lt;a class="zem_slink" href="http://en.wikipedia.org/wiki/Professional_certification" title="Professional certification" rel="wikipedia"&gt;certification exam&lt;/a&gt; will be the next. Let me know about your certification thoughts. By the way I don't work for Transcender.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;Good day,&lt;/div&gt;&lt;div&gt;Bulent&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-3858100129543163588?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/3858100129543163588/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2011/03/70-432-ts-microsoft-sql-server-2008_05.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/3858100129543163588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/3858100129543163588'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2011/03/70-432-ts-microsoft-sql-server-2008_05.html' title='70-432 TS: Microsoft SQL Server 2008, Implementation and Maintenance'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-4339910978851353102</id><published>2010-12-20T09:47:00.006-07:00</published><updated>2010-12-20T10:00:21.416-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Software versioning'/><category scheme='http://www.blogger.com/atom/ns#' term='Service pack'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='Database Administration'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'></title><content type='html'>&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Hello all,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Microsoft released the &lt;a class="zem_slink" href="http://en.wikipedia.org/wiki/Service_pack" title="Service pack" rel="wikipedia"&gt;Service Pack 4&lt;/a&gt; for &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;SQL&lt;/span&gt; Server 2005 to &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;RTM&lt;/span&gt; on 12/17/2010 kind of quietly before the holidays.  The &lt;a class="zem_slink" href="http://en.wikipedia.org/wiki/Software_versioning" title="Software versioning" rel="wikipedia"&gt;version number&lt;/a&gt; is 9.00.5000.00 once the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;sp&lt;/span&gt;4 is installed.  Here is the &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=b953e84f-9307-405e-bceb-47bd345baece&amp;amp;displaylang=en"&gt;link&lt;/a&gt; that will take you to download site and this &lt;a href="http://support.microsoft.com/?kbid=2463332"&gt;link&lt;/a&gt; is for what's fixed with &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;sp&lt;/span&gt;4.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;HTH&lt;/span&gt;,&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;Bulent&lt;/span&gt;&lt;/div&gt;  &lt;div class="zemanta-pixie" style="margin-top:10px;height:15px"&gt;&lt;a class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"&gt;&lt;img class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=df9a20b4-36ef-4151-a0d9-887ec26da3ad" alt="Enhanced by Zemanta" style="border:none;float:right" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-4339910978851353102?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/4339910978851353102/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2010/12/hello-all-microsoft-released-service.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/4339910978851353102'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/4339910978851353102'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2010/12/hello-all-microsoft-released-service.html' title=''/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-3772895965643958279</id><published>2010-11-29T11:02:00.004-07:00</published><updated>2010-11-29T12:13:50.748-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Integration Services'/><category scheme='http://www.blogger.com/atom/ns#' term='Dataflow'/><title type='text'>SSIS Warning: Truncation May Occur</title><content type='html'>I was working on SSIS package to load data from several sources into final destination table. And I see a yellow exclamation mark on data flow task from one of the sources. The message was 'Warning: Truncation may occur due to inserting data from data flow column "Description" with a length of 255 to database column "Description" with a length of 250. When I checked the source column length and destination it was obvious that the lengths of the columns were different and SSIS was correct about complaining. I verified that there was not a record that was inserted with the length greater than 175 char (the field is populated by app in one of the 5 possible defined descriptions). So I did the changes below to get SSIS stop complaining about the length of the column. To fix the issue follow the steps below:&lt;br /&gt;&lt;br /&gt;Open the Data Flow task&lt;br /&gt;&lt;br /&gt;On the source task right click and select Advanced Editor&lt;br /&gt;&lt;br /&gt;Click on Input and Output Properties tab&lt;br /&gt;&lt;br /&gt;Expand OLE DB Source Output&lt;br /&gt;&lt;br /&gt;Expand External columns and check the columns we need&lt;br /&gt;&lt;br /&gt;Expand Output Columns&lt;br /&gt;&lt;br /&gt;Click on corresponding column&lt;br /&gt;&lt;br /&gt;Change Length property of the column to desired length and refresh.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Also on Destination side:&lt;br /&gt;&lt;br /&gt;Open Advanced Editor (on OLE DB Destination)&lt;br /&gt;&lt;br /&gt;Click on Input and Output Properties tab&lt;br /&gt;&lt;br /&gt;Click on Refresh button&lt;br /&gt;&lt;br /&gt;Check the value of the length is correct&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;HTH,&lt;br /&gt;&lt;br /&gt;Bulent&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-3772895965643958279?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/3772895965643958279/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2010/11/ssis-warning-truncation-may-occur.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/3772895965643958279'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/3772895965643958279'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2010/11/ssis-warning-truncation-may-occur.html' title='SSIS Warning: Truncation May Occur'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-4346865867024365131</id><published>2010-09-20T14:37:00.002-06:00</published><updated>2010-09-20T14:49:13.974-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Partitioning'/><category scheme='http://www.blogger.com/atom/ns#' term='Database Administration'/><title type='text'>SQL Server Error 5042 Can Not Remove File X Because It's Not Emty</title><content type='html'>Couple weeks ago one of the job failed with the message stating that the file can not be removed because it is not empty.  I have implemented quite a few partitioned tables and created a stored procedure which switches data from a 3 months old partition and then merge the partition.  The process has been working fine but suddenly it failed.  I check the partitions, but there was nothing in the file.  I started to search the Internet and I found a help in &lt;a href="http://www.sqlservercentral.com/blogs/jeffrey_yao/archive/2009/08/11/error-5042-cannot-remove-a-file-because-it-is-not-empty.aspx"&gt;here&lt;/a&gt; by Jeffrey Yao at SQLServerCentral.com.  In my case the file was created originally 5 GB in size but during the month it grew to 5.5 GB in size and the file size was still 5.5 GB.  I followed Jeffrey's steps and shrank the file to it's original size of 5 GB and then the process ran successfully to merge the partition.&lt;br /&gt;&lt;br /&gt;HTH&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-4346865867024365131?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/4346865867024365131/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2010/09/sql-server-error-5042-can-not-remove.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/4346865867024365131'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/4346865867024365131'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2010/09/sql-server-error-5042-can-not-remove.html' title='SQL Server Error 5042 Can Not Remove File X Because It&apos;s Not Emty'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-6585513342754167403</id><published>2010-09-17T08:16:00.006-06:00</published><updated>2010-09-17T11:23:11.580-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><category scheme='http://www.blogger.com/atom/ns#' term='Database Administration'/><title type='text'>SQL Server Collate Clause And Case Sensitivity</title><content type='html'>The servers in the current environment I am working has been configured with case insensitive collation by default during the installation.  I had to help a developer who was trying to write a clr function to compare values stored in a database.  We had to find out all the uppercase first and last names stored in one of the tables.  The columns in the table have been created case insensitive.  I thought of using built in feature instead of doing it in CLR and finding out the results.  As you see in the simple script below I am creating 4 columns 2 case insensitive and 2 case sensitive.  Populate it with sample data and finally compare the columns against each other.  Note that once you create a columns like this you can not compare case insensitive column against so pay attention the where clause in the select statements.  With this simple solution we were able to easily produce all the records stored in uppercase in the table.  For more information look in the Books Online and search for collate&lt;br /&gt;&lt;br /&gt;HTH,&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;USE tempdb&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;CREATE TABLE dbo.CaseSensitiveTest(&lt;br /&gt;      RowId TINYINT IDENTITY (1,1),&lt;br /&gt;      CIFName VARCHAR   (30),&lt;br /&gt;      CILName VARCHAR (30),&lt;br /&gt;      CSFName VARCHAR (30) COLLATE Latin1_General_CS_AS,&lt;br /&gt;      CSLName VARCHAR (30) COLLATE Latin1_General_CS_AS&lt;br /&gt;&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;INSERT INTO dbo.CaseSensitiveTest&lt;br /&gt;SELECT      'MICKEY', 'MOUSE', 'Mickey','Mouse'&lt;br /&gt;UNION ALL&lt;br /&gt;SELECT      'mickey', 'mouse', 'mickey','mouse'&lt;br /&gt;UNION ALL&lt;br /&gt;SELECT      'mickey', 'mouse', 'Mickey','Mouse'&lt;br /&gt;UNION ALL&lt;br /&gt;SELECT      'MICKEY', 'MOUSE', 'MICKEY','MOUSE'&lt;br /&gt;UNION ALL&lt;br /&gt;SELECT      'bunny', 'rabbit', 'Bunny','Rabbit'&lt;br /&gt;UNION ALL&lt;br /&gt;SELECT      'BUNNY', 'RABBIT', 'BUNNY', 'RABBIT'&lt;br /&gt;&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;SELECT * FROM dbo.CaseSensitiveTest&lt;br /&gt;&lt;br /&gt;SELECT *&lt;br /&gt;FROM  dbo.CaseSensitiveTest&lt;br /&gt;WHERE CIFName COLLATE Latin1_General_CS_AS = CSFName&lt;br /&gt;AND      CIFName COLLATE Latin1_General_CS_AS = UPPER(CIFname)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;DROP TABLE dbo.CaseSensitiveTest&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-6585513342754167403?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/6585513342754167403/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2010/09/sql-server-collate-clause-and-case.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/6585513342754167403'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/6585513342754167403'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2010/09/sql-server-collate-clause-and-case.html' title='SQL Server Collate Clause And Case Sensitivity'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-7102480119465662433</id><published>2010-07-31T07:50:00.002-06:00</published><updated>2010-07-31T08:01:10.158-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>SQL Server Failed to Alert Operator</title><content type='html'>I just deployed a new SQL Server Server and set up some jobs.  Couple of days later wanted to check the server and see how jobs were executing.  I was surprised to find out one job has been failing and I remember not seeing any alert.  I did remember that I set up database mail and operators.  Job history tells me that sql server failed to notify the operator.   I started to look around and finally thought of checking the sql server agent properties.  To my surprise I found out that I forgot to set up the properties under alert and putting check for enable email profile, selecting the profile and another check for enabling fail safe operator did all the trick.  After changing the setting started to work and sql server agent started to notify me with emails.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;HTH&lt;/div&gt;  &lt;div class="zemanta-pixie" style="margin-top:10px;height:15px"&gt;&lt;a class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"&gt;&lt;img class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=85d29133-b48c-4f69-a729-86f265f95200" alt="Enhanced by Zemanta" style="border:none;float:right" /&gt;&lt;/a&gt;&lt;span class="zem-script more-related pretty-attribution"&gt;&lt;script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"&gt;&lt;/script&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-7102480119465662433?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/7102480119465662433/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2010/07/sql-server-failed-to-alert-operator.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/7102480119465662433'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/7102480119465662433'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2010/07/sql-server-failed-to-alert-operator.html' title='SQL Server Failed to Alert Operator'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-4056860131874395304</id><published>2010-07-09T23:17:00.004-06:00</published><updated>2010-07-09T23:34:19.939-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='FAQs  Help  and Tutorials'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft Developer Network'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft SQL Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><category scheme='http://www.blogger.com/atom/ns#' term='Website'/><title type='text'>SQL Server 2008 Invalid SKU error</title><content type='html'>I was trying to set up SQL Server 2008 Cluster on Windows 2008 OS.  Creating the cluster with a single node went pretty smooth.  However when I wanted to add the second node to cluster I kept getting 'Invalid SKU error' and installation kept aborting the operation.  I downloaded the new ISO of SQL Server 2008 from MSDN website with no help.  Searching the net came out with the link below which stated that it was a know bug and ways to workaround it.  I started the setup process from command line using the command below.  At the end the node has been added with success.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here is the command that I started the installation:&lt;/div&gt;&lt;div&gt;setup.exe /q /ACTION=AddNode /INSTANCENAME="&lt;insert&gt;"&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Microsoft Connect bug report &lt;a href="http://connect.microsoft.com/SQLServer/feedback/details/363036/add-node-to-sql-server-failover-cluster-failed-with-invalid-sku-error"&gt;site&lt;/a&gt;:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;HTH&lt;/div&gt;  &lt;div class="zemanta-pixie" style="margin-top:10px;height:15px"&gt;&lt;a class="zemanta-pixie-a" href="http://www.zemanta.com/" title="Enhanced by Zemanta"&gt;&lt;img class="zemanta-pixie-img" src="http://img.zemanta.com/zemified_e.png?x-id=ba701869-728c-40b0-8a11-f3d4d5df94f0" alt="Enhanced by Zemanta" style="border:none;float:right" /&gt;&lt;/a&gt;&lt;span class="zem-script more-related pretty-attribution"&gt;&lt;script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"&gt;&lt;/script&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-4056860131874395304?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/4056860131874395304/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2010/07/sql-server-2008-invalid-sku-error.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/4056860131874395304'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/4056860131874395304'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2010/07/sql-server-2008-invalid-sku-error.html' title='SQL Server 2008 Invalid SKU error'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-148812300603768996</id><published>2010-05-04T13:05:00.003-06:00</published><updated>2010-05-04T13:07:16.335-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008 R2'/><title type='text'>SQL Server 2008 R2 Availalbe to Download</title><content type='html'>SQL Server 2008 R2 is available for downloading to MSDN and Technet subscribers.  Here are the links:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://msdn.microsoft.com/subscriptions" mce_href="http://msdn.microsoft.com/subscriptions"&gt;http://msdn.microsoft.com/subscriptions&lt;/a&gt;   &lt;/li&gt;&lt;li&gt;&lt;a href="http://technet.microsoft.com/subscriptions" mce_href="http://technet.microsoft.com/subscriptions"&gt;http://technet.microsoft.com/subscriptions&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-148812300603768996?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/148812300603768996/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2010/05/sql-server-2008-r2-availalbe-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/148812300603768996'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/148812300603768996'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2010/05/sql-server-2008-r2-availalbe-to.html' title='SQL Server 2008 R2 Availalbe to Download'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-2555817331149947211</id><published>2010-04-23T13:28:00.003-06:00</published><updated>2010-04-23T13:59:49.027-06:00</updated><title type='text'>Implicit Data Type Conversion</title><content type='html'>Hello all,&lt;br /&gt;&lt;br /&gt;Yesterday by accident I ran into a query running slow.  In this case the query is generated by Nhibernate.  After looking at the query and execution plan I figured out that it was the implicit data type conversion.&lt;br /&gt;&lt;br /&gt;The data in the table is stored in column of varchar data type.  The column is a primary key with clustered index.  However the query is issued against the table with a parameter passed in and it's declared as NVARCHAR.  Do you see where this is going?  So when the query is executed with nvarchar parameter sql server does an index scan on the clustered key and converts each column data to nvarchar and then compares the result against the parameter passed in.  As we all know clustered index scan is equal to table scan.&lt;br /&gt;&lt;br /&gt;I changed the query and declared the parameter as varchar and ran it.  It worked as expected.  There was no need to do a data type conversion so SQL Server used Clustered Index Seek operator and completed the operation 4 times faster than the slow query.  In my case the table I am talking has 199K rows.  Imagine how much slower it could be if it had millions of rows.&lt;br /&gt;&lt;br /&gt;I talked to principal architect and the solution was to update Nhibernate mappings.  He said that Nhibernate by default maps to nvarchar data type and if you're not using nvarchar for unicode characters in your table you definitely want to map Nhibernate to your tables properly using correct data type.&lt;br /&gt;&lt;br /&gt;HTH,&lt;br /&gt;&lt;br /&gt;MileHighDBA&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-2555817331149947211?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/2555817331149947211/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2010/04/implicit-data-type-conversion.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/2555817331149947211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/2555817331149947211'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2010/04/implicit-data-type-conversion.html' title='Implicit Data Type Conversion'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-5236815699921134815</id><published>2010-04-21T14:10:00.003-06:00</published><updated>2010-04-21T14:40:14.132-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008 R2'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL 2008 R2 RTM'/><title type='text'>SQL Server 2008 R2 Released To Manufacturing</title><content type='html'>Here is the &lt;a href="http://blogs.technet.com/dataplatforminsider/archive/2010/04/21/sql-server-2008-r2-released-to-manufacturing.aspx"&gt;announcement&lt;/a&gt; from Microsoft Data Platform blog that SQL Server 2008 R2 has been released to manufacturing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-5236815699921134815?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/5236815699921134815/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2010/04/sql-server-2008-r2-released-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/5236815699921134815'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/5236815699921134815'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2010/04/sql-server-2008-r2-released-to.html' title='SQL Server 2008 R2 Released To Manufacturing'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-6366540278452538118</id><published>2010-04-15T22:58:00.000-06:00</published><updated>2010-04-15T23:03:33.599-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><category scheme='http://www.blogger.com/atom/ns#' term='Database Administration'/><title type='text'>SQL Server 2008 R2</title><content type='html'>Here is the &lt;a href="http://download.microsoft.com/download/C/D/1/CD1648C1-46BC-4C79-B16F-7AF650C186B4/693883ebook.pdf"&gt;link&lt;/a&gt; to free &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;ebook&lt;/span&gt; download from Microsoft.  Start learning before the product releases on May 2010.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-6366540278452538118?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/6366540278452538118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2010/04/sql-server-2008-r2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/6366540278452538118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/6366540278452538118'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2010/04/sql-server-2008-r2.html' title='SQL Server 2008 R2'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-1528635433755128644</id><published>2010-04-15T14:47:00.000-06:00</published><updated>2010-04-15T22:47:48.228-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Programming'/><category scheme='http://www.blogger.com/atom/ns#' term='Transact-SQL'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>SQL Server Trimming miliseconds (Zero out miliseconds)</title><content type='html'>Hi,&lt;br /&gt;Where I work we needed to zero out the milliseconds from a datetime field in one of the database.  I found out that somebody created function below which returns the passed datetime with the milliseconds zero out.  Instead of 2010-04-15 14:50:49.953 this time we needed to return 2010-04-15 14:50:49.000.  When I looked at the function I thought there is just to much DATEPART, CONVERT and concatenation being used.  And I asked myself If I could make it much shorter, cleaner.  So I did come up with a result and it works.  Here is the original function:&lt;br /&gt;SET ANSI_NULLS ON&lt;br /&gt;GO&lt;br /&gt;SET QUOTED_IDENTIFIER OFF&lt;br /&gt;GO&lt;br /&gt;CREATE FUNCTION [dbo].[TrimMilliseconds] (@D datetime)&lt;br /&gt;RETURNS datetime&lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;   DECLARE @Date datetime&lt;br /&gt;   SET @Date = CONVERT(datetime,&lt;br /&gt;               CONVERT(varchar(4), DATEPART(yyyy, @D)) + '-' +&lt;br /&gt;               CONVERT(varchar(2), DATEPART(mm, @D)) + '-' +&lt;br /&gt;               CONVERT(varchar(2), DATEPART(dd, @D)) + ' ' +&lt;br /&gt;               CONVERT(varchar(2), DATEPART(Hh, @D)) + ':' +&lt;br /&gt;               CONVERT(varchar(2), DATEPART(mi, @D)) + ':' +&lt;br /&gt;               CONVERT(varchar(2), DATEPART(ss, @D)))&lt;br /&gt;&lt;br /&gt;   return @Date&lt;br /&gt;END&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;Here is my updated version:&lt;br /&gt;SET ANSI_NULLS ON&lt;br /&gt;GO&lt;br /&gt;SET QUOTED_IDENTIFIER OFF&lt;br /&gt;GO&lt;br /&gt;CREATE FUNCTION [dbo].[TrimMillisecondsNew] (@D datetime)&lt;br /&gt;RETURNS datetime&lt;br /&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;   DECLARE @Date datetime&lt;br /&gt;   SET @Date = CAST(CONVERT(VARCHAR(19),@D,20) AS DATETIME)&lt;br /&gt;&lt;br /&gt;   return @Date&lt;br /&gt;END&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;As you see the second function is much cleaner and simpler.  I only used convert and cast functions once to do the work.  Less typing, less t-sql, work is done.  &lt;div class="zemanta-pixie" style="margin-top:10px;height:15px"&gt;&lt;a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/441b43c2-880e-4f57-be77-94b3c4405425/" title="Reblog this post [with Zemanta]"&gt;&lt;img class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_e.png?x-id=441b43c2-880e-4f57-be77-94b3c4405425" alt="Reblog this post [with Zemanta]" style="border:none;float:right" /&gt;&lt;/a&gt;&lt;span class="zem-script more-related pretty-attribution"&gt;&lt;script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"&gt;&lt;/script&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-1528635433755128644?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/1528635433755128644/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2010/04/sql-server-trimming-miliseconds-or-zero.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/1528635433755128644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/1528635433755128644'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2010/04/sql-server-trimming-miliseconds-or-zero.html' title='SQL Server Trimming miliseconds (Zero out miliseconds)'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-1033138192091671646</id><published>2010-04-06T15:04:00.000-06:00</published><updated>2010-04-06T15:10:50.454-06:00</updated><title type='text'>24 Hours Of Pass 2010</title><content type='html'>Check the&lt;a href="http://www.sqlpass.org/24hours/2010/"&gt; link&lt;/a&gt; to obtain information and register for 24 hours of Pass 2010.  This is 24 hours of back to back SQL Server related webcasts starting on May 19 at 12:00 GMT(UTC).  There are a lot of good presentations available go ahead, check it out and register now.  I don't think I can watch all but I hope I will have time for most.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-1033138192091671646?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/1033138192091671646/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2010/04/24-hours-of-pass-2010.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/1033138192091671646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/1033138192091671646'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2010/04/24-hours-of-pass-2010.html' title='24 Hours Of Pass 2010'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-379625276547357753</id><published>2010-04-02T12:25:00.000-06:00</published><updated>2010-04-02T13:56:51.999-06:00</updated><title type='text'>MSSQL Replication 'Field Size Too Large'</title><content type='html'>Back from a vacation and I am ready to blog at least once a week. Last  week there was an update to a large table which was involved in  transactional replication.  We wanted to move from using GUID as primary  key and implement integer based identity key.  So I had to stop  publishing the table to be able to drop the primary key and add a new  column, populate it create the primary key on the new column.&lt;br /&gt;&lt;br /&gt;So  we had the script executed to do the job.  The I used the same script  which alters the table to make the necessary changes in the subscriber  database.  Because the table in subscriber was in different file group  with different indexes and I did not want to the replication drop and  recreate the table itself (which is default).  I then initiated the  replication with a new snapshot and waited for 5 minutes.  Then I saw  the error message and found out that it's complaining about the field  size too larger.  How can that be?  Both tables are exactly same for the  basic schema.  I tried to create a new snapshot with the same ugly  error message.  Then I decided to script out my additional indexes in  subscriber and dropped the table.  I created the table in subscriber  from a script created in the publisher with my additional indexes in the  specific file group I want.  The I set the publication to create a new  snapshot with leaving the target table in subscriber left as it is.  And  that did it.&lt;br /&gt;&lt;br /&gt;Hope this helps.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-379625276547357753?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/379625276547357753/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2010/04/mssql-replication-field-size-too-larger.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/379625276547357753'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/379625276547357753'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2010/04/mssql-replication-field-size-too-larger.html' title='MSSQL Replication &apos;Field Size Too Large&apos;'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-1223545564141489030</id><published>2010-02-13T08:46:00.001-07:00</published><updated>2010-02-13T08:50:27.241-07:00</updated><title type='text'>SQL Server 2005 and 2008 Service Pack Announcements</title><content type='html'>Microsoft announced the upcoming targeted release dates for SQL Server 2005 and 2008 Service Packs.&lt;br /&gt;&lt;br /&gt;SQL Server 2005 Service Pack 4 targeted release date is Q42010.&lt;br /&gt;SQL Server 2008 Service Pack 2 targeted release date is Q32010.&lt;br /&gt;&lt;br /&gt;For most people who has been waiting for SQL 2005 SP4 maybe over before the end of the year.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-1223545564141489030?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/1223545564141489030/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2010/02/sql-server-2005-and-2003-service-pack.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/1223545564141489030'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/1223545564141489030'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2010/02/sql-server-2005-and-2003-service-pack.html' title='SQL Server 2005 and 2008 Service Pack Announcements'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-2560665709477711167</id><published>2010-02-05T20:45:00.000-07:00</published><updated>2010-02-05T21:05:18.170-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Suspect_Pages'/><category scheme='http://www.blogger.com/atom/ns#' term='MSDB'/><title type='text'>Suspect_Pages</title><content type='html'>I think not many database administrators are aware of the msdb.dbo.suspect_pages table in SQL Server 2005/2008.  The database engine uses this table to record possible suspect page data.  It records the pageid and event_type_value which indicates what type of error or how the page repaired along with some other data.  For detecting suspect page in your server I recommend setting up a job which looks at that table with certain event_type_value.  (the values can be 1,2,3,4,5,7)  If database engine records a row with value less than equal to 3 then it means you're facing possible CRC failure, checksum error, or torn page.  Then you can send an email alert to your self to start looking for solution.  You can use DBCC commands to repair the page or if it does nt work you may have to restore the page from a backup.  Suspect_pages table is like having some early warning system so I think dba's should use this table to alert themselves.  You can read more about it &lt;a href="http://msdn.microsoft.com/en-us/library/ms191301.aspx"&gt;here&lt;/a&gt; on MSDN Site.&lt;br /&gt;&lt;br /&gt;HTH&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-2560665709477711167?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/2560665709477711167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2010/02/suspectpages.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/2560665709477711167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/2560665709477711167'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2010/02/suspectpages.html' title='Suspect_Pages'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-4919512501782883628</id><published>2010-01-30T11:59:00.000-07:00</published><updated>2010-01-30T12:50:32.897-07:00</updated><title type='text'>SQL Server 2008 System Views Map</title><content type='html'>Microsoft has published SQL Server 2008 System View map in .pdf and .xps file format.  It's a must for SQL Server DBA.  Get the map from &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=531c53e7-8a2a-4375-8f2f-5d799aa67b5c&amp;amp;displaylang=en"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-4919512501782883628?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/4919512501782883628/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2010/01/sql-server-2008-system-views-map.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/4919512501782883628'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/4919512501782883628'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2010/01/sql-server-2008-system-views-map.html' title='SQL Server 2008 System Views Map'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-3371014001353416198</id><published>2010-01-22T12:04:00.000-07:00</published><updated>2010-01-22T12:16:21.254-07:00</updated><title type='text'>Cannot drop the database 'MyDatabase' because it is being used for replication. [SQLSTATE 42000] (Error 3724)</title><content type='html'>I wanted to drop and restore a database which I restored couple days ago in a test environment.  The same db in production is the publisher and there are objects in transactional replication.  I was asked to restore the new backup.  However drop database returned the error message in the subject line and did not drop the db.  Little bit of searching and I found out that the stored procedure can be used to remove the replication prior to dropping the database in test environment.  So I connected to my test server and executed following statements in the order.&lt;br /&gt;&lt;br /&gt;1.  USE MASTER EXEC dbo.sp_removedbreplication @dbname = 'MyDatabase'&lt;br /&gt;2.  USE MASTER DROP DATABASE MyDatabase&lt;br /&gt;&lt;br /&gt;It worked and I was able to drop and restore the latest backup to the test environment.&lt;br /&gt;&lt;br /&gt;Do not run this in production since it will remove the replication from your production publisher.&lt;br /&gt;&lt;br /&gt;HTH,&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-3371014001353416198?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/3371014001353416198/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2010/01/cannot-drop-database-mydatabase-because.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/3371014001353416198'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/3371014001353416198'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2010/01/cannot-drop-database-mydatabase-because.html' title='Cannot drop the database &apos;MyDatabase&apos; because it is being used for replication. [SQLSTATE 42000] (Error 3724)'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-1389721788923904545</id><published>2010-01-15T16:43:00.001-07:00</published><updated>2010-12-07T09:59:00.161-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='SA Login Disabled'/><title type='text'>SQL Server SA Login Disabled and Can Not Login To Server</title><content type='html'>I needed to fix the login issue on newly installed SQL Server 2008 developer edition for a developer who is just starting to work.  The tech who prepared the workstations forgot to add the local admin and the AD user account and he was out of the office.  So even with the local administrator account no once can log in to SQL Server.  Thanks to new security settings of SQL Server 2008.  I did a little research and found out the solution.  Here is the list of actions for the solution.  First open the SQL Server Configuration Manager.&lt;br /&gt;&lt;br /&gt;1.  Stop SQL Server Service.&lt;br /&gt;2.  Double click on SQL Server service and goto advanced tab.&lt;br /&gt;3.  add -m; to the beginning of Startup Parameters&lt;br /&gt;4.  Start SQL Server Service&lt;br /&gt;5.  Open command prompt and connect to your the server using SQLCMD&lt;br /&gt;6.  Create a log in (CREATE LOGIN BillGates WITH PASSWORD = 'password')&lt;br /&gt;7.  Now add the log in to sysadmin group (EXEC sp_addsrvrolemember 'BillGates','sysadmin')&lt;br /&gt;8.  Remember you need to issue GO command to execute the commands.&lt;br /&gt;9.  Once you created the login and add it to sysadmin role go to SQL Server Configuration Manager.&lt;br /&gt;10.  Stop SQL Server service.&lt;br /&gt;11.  Remove -m; from startup parameters.&lt;br /&gt;12.  Start SQL Server Service and login with the user that you just created.&lt;br /&gt;13.  Now you have sysadmin rights.&lt;br /&gt;&lt;br /&gt;HTH,&lt;br /&gt;&lt;br /&gt;Bulent&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-1389721788923904545?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/1389721788923904545/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2010/01/sql-server-sa-login-disabled-and-can.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/1389721788923904545'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/1389721788923904545'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2010/01/sql-server-sa-login-disabled-and-can.html' title='SQL Server SA Login Disabled and Can Not Login To Server'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-4486662295201811679</id><published>2009-08-25T23:01:00.001-06:00</published><updated>2009-08-25T23:02:07.052-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2008 BOL'/><title type='text'>SQL Server 2008 BOL July 2009 Update</title><content type='html'>July 2009 Sql Server 2008 BOL update has been released by Microsoft.  You can download and install it from &lt;a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=765433f7-0983-4d7a-b628-0a98145bcb97"&gt;here&lt;/a&gt; or use the &lt;a href="http://msdn.microsoft.com/en-us/library/ms130214.aspx"&gt;online version&lt;/a&gt;.  BOL is full of great information and code examples.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-4486662295201811679?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/4486662295201811679/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2009/08/sq.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/4486662295201811679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/4486662295201811679'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2009/08/sq.html' title='SQL Server 2008 BOL July 2009 Update'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3842644106145230578.post-1667629843491042666</id><published>2009-04-07T23:11:00.000-06:00</published><updated>2009-04-07T23:13:07.444-06:00</updated><title type='text'>SQL Server 2008 SP1</title><content type='html'>&lt;span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: 'Trebuchet MS'; font-size: 13px; line-height: 18px; "&gt;SQL Server 2008 SP1 is available to download at the link below.  It includes the previous hotfixes and Microsoft made deployment and management of service pack.  2 really good feautres added to service pack are&lt;div&gt;1.  Slipstream&lt;/div&gt;&lt;div&gt;2.  SP can be uninstalled without removing the whole instance.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The new build number is 10.00.2531.00&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=66ab3dbb-bf3e-4f46-9559-ccc6a4f9dc19" style="color: rgb(34, 51, 68); "&gt;http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=66ab3dbb-bf3e-4f46-9559-ccc6a4f9dc19&lt;/a&gt;&lt;/div&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3842644106145230578-1667629843491042666?l=milehighdba.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://milehighdba.blogspot.com/feeds/1667629843491042666/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://milehighdba.blogspot.com/2009/04/sql-server-2008-sp1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/1667629843491042666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3842644106145230578/posts/default/1667629843491042666'/><link rel='alternate' type='text/html' href='http://milehighdba.blogspot.com/2009/04/sql-server-2008-sp1.html' title='SQL Server 2008 SP1'/><author><name>Mile High DBA</name><uri>http://www.blogger.com/profile/06000141089856801282</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/-JYhe22nwKP0/TxnL5kF3ZmI/AAAAAAAAALM/UIci6GF-ItA/s220/Bulent.jpg'/></author><thr:total>0</thr:total></entry></feed>
