<?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-4103619847444885405</id><updated>2012-02-01T07:29:14.545-08:00</updated><category term='SQL Server Database Mail'/><category term='PASS 2009'/><category term='Snapshot Disaster Recovery'/><category term='SQL Summit 2009'/><category term='Error 665'/><category term='Error 1450'/><category term='Database Mail from Trigger'/><category term='SQL Server Background'/><category term='Snapshot Sparse Files'/><category term='SQL Server Snapshots'/><category term='SQL Server 2005 Administration'/><category term='Sparse File Size'/><category term='Discount Code'/><title type='text'>Clay's SQL Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://claysql.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://claysql.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Clay McDonald</name><uri>http://www.blogger.com/profile/00861387900854837549</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://1.bp.blogspot.com/_p-E9D6bFkUY/SaVuWj-vwYI/AAAAAAAAAAo/bZ0v1BRWtJE/S220/IMG00060.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>23</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4103619847444885405.post-3580429403547390672</id><published>2012-02-01T07:16:00.000-08:00</published><updated>2012-02-01T07:29:14.758-08:00</updated><title type='text'>Free ebook: Introducing Microsoft SQL Server 2012</title><content type='html'>Microsoft Press is releasing a free ebook: Introducing Microsoft SQL Server 2012 (second DRAFT preview)by Ross Mistry and Stacia Misner. This Draft Preview release is only available in PDF format. To get the full details, look here; &lt;a href="http://blogs.msdn.com/b/microsoft_press/archive/2012/01/31/free-ebook-introducing-microsoft-sql-server-2012-second-draft-preview.aspx"&gt;Microsoft Press&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4103619847444885405-3580429403547390672?l=claysql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claysql.blogspot.com/feeds/3580429403547390672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claysql.blogspot.com/2012/02/free-ebook-introducing-microsoft-sql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/3580429403547390672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/3580429403547390672'/><link rel='alternate' type='text/html' href='http://claysql.blogspot.com/2012/02/free-ebook-introducing-microsoft-sql.html' title='Free ebook: Introducing Microsoft SQL Server 2012'/><author><name>Clay McDonald</name><uri>http://www.blogger.com/profile/00861387900854837549</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://1.bp.blogspot.com/_p-E9D6bFkUY/SaVuWj-vwYI/AAAAAAAAAAo/bZ0v1BRWtJE/S220/IMG00060.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103619847444885405.post-7471796942185338880</id><published>2012-01-08T09:06:00.000-08:00</published><updated>2012-01-08T10:02:04.175-08:00</updated><title type='text'>Correcting Hadoop's HDFS java.io.IOException Errors</title><content type='html'>&lt;p&gt;&lt;span style="font-size:85%;"&gt;This past Christmas and New Year, like the last three years now, I accompanied my wife to Bogota, Colombia for the holidays. The difference about this trip was; our pet Mickey was going with us, we had no side trips planned, and I was taking my new Lenovo T420 with me. We arrived in Bogota late at night on December, 22nd, and after being greeted by family, we took a cab to my mother-in-laws house. There’s something both exciting and terrifying about cab rides in Bogota, but after time, for me at least, it’s just fun.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;I woke up the next morning well rested and we began our Christmas vacation. I began setting up a new wireless router that I had brought with me so that I could work remotely from wherever was most comfortable. After having installed the router, I connected with my new laptop and set my priorities for the task that I needed to complete. Was the typical task, update my time, respond to some emails, finalize peer reviews, and check up on database backups. After these tasks were completed, I had time to relax.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;What was planned for us was day to day, but mostly we would go out to have lunch or dinner with friends and family, then return home. On a few nights, we engaged in consuming heavy amounts of adult beverages and dancing which is the custom in Colombia. Most of our time however, was spent at home. &lt;/span&gt;&lt;span style="font-size:85%;"&gt;I would wake up early, before anyone else, and sit at the dining room table, next to the window with my laptop and watch the sun rise over the mountains enjoying some fresh Colombian coffee.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;With nothing to do so early in the morning, I decided to log onto my desktop back in DC. When I connected to my desktop, I saw that I had left open a ssh connection to a small Hadoop cluster I had setup to do some testing, except HDFS was not working properly. This was the perfect opportunity to find out what went wrong in my install and configuration of the cluster. The only catch was, is that I would have do everything from the command shell, no gui. I had followed &lt;a href="http://www.michael-noll.com/tutorials/running-hadoop-on-ubuntu-linux-single-node-cluster/" target="_blank"&gt;Michael Noll’s “Running Hadoop on Ubuntu”&lt;/a&gt;,but now, I was getting errors in the namenode logs.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;I was getting java.io.IOException errors. In Michael Noll’s how-to, he describes how he addressed this error by reformatting the cluster. He described how he stopped all running daemons and deleted the /app/hadoop/tmp/hdf/name/data directory and then ran bin/hadoop namenode –format . Somewhere in my troubleshooting my errors and researching online, I found that it was also a good idea to add the following properties to the hdfs-site.xml configuration file.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&amp;lt; !-- Adding dfs.data.dir dfs.name.dir 1/1/2012. -- &amp;gt; &lt;br /&gt;&amp;lt; property &amp;gt; &lt;br /&gt;&amp;lt; name &amp;gt; dfs.data.dir &amp;lt; /name &amp;gt; &lt;br /&gt;&amp;lt; value &amp;gt; /app/hadoop/tmp/dfs/name/data &amp;lt; /value &amp;gt; &lt;br /&gt;&amp;lt; final &amp;gt; true &amp;lt; /final &amp;gt; &lt;br /&gt;&amp;lt; /property &amp;gt; &lt;br /&gt;&amp;lt; property &amp;gt; &lt;br /&gt;&amp;lt; name &amp;gt; dfs.name.dir &amp;lt; /name &amp;gt; &lt;br /&gt;&amp;lt; value &amp;gt; /app/hadoop/tmp/dfs/name &amp;lt; /value &amp;gt; &lt;br /&gt;&amp;lt; final &amp;gt; true &amp;lt; /final &amp;gt; &lt;br /&gt;&amp;lt; /property &amp;gt; &lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;Also, if you get permission denied (publickey,password), you may want to check that the paths for the properties you added to the hdfs-site.xml file are correct. If this problem persist, you might try running the following on all nodes;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;em&gt;sudo chown –R hduser:hadoop /app/hadoop&lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Some of the other errors that I ran into were as follows;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Cannot lock storage /app/hadoop/tmp/dfs/name. The directory is already locked.&lt;/em&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;org.apache.hadoop.hdfs.server.namenode.FSNamesystem: Fatal Error : All storage directories are inaccessible.&lt;/em&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;ERROR org.apache.hadoop.hdfs.server.namenode.NameNode: java.net.BindException: Problem binding to Address already in use&lt;/em&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;I did not do a good job at keeping notes during my troubleshooting these issues, but it seemed that whenever I would try to fix one thing, a different error would pop up. I did find that I had made an typo in the hdfs-site.xml file. At the end of each path, I had added a /. Therefore, instead of &lt;value&gt;/app/hadoop/tmp/dfs/name&lt;/value&gt;, I had &lt;value&gt;/app/hadoop/tmp/dfs/name/&lt;/value&gt;. But once I corrected that and delete all data in the HDFS directory and then ran format, everything worked! So here is how that went.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;After stopping all daemons and correcting the paths in the hdfs-site.xml file, I then deleted all data in the HDFS directory on all nodes.&lt;br&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;hduser@bigdata1:/app/hadoop/tmp/dfs$"&amp;gt;hduser@bigdata1:/app/hadoop/tmp/dfs$ sudo rm -rf *&lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Then, I ran the format.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;hduser@bigdata1:/usr/local/hadoop/hadoop$ bin/hadoop namenode –format&lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;The output looks like;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;12/01/04 07:59:15 INFO namenode.NameNode: STARTUP_MSG:&lt;br /&gt;/************************************************************&lt;br /&gt;STARTUP_MSG: Starting NameNode&lt;br /&gt;STARTUP_MSG: host = bigdata1/172.20.10.92&lt;br /&gt;STARTUP_MSG: args = [-format]&lt;br /&gt;STARTUP_MSG: version = 0.20.2&lt;br /&gt;STARTUP_MSG: build = https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20 -r 911707; compiled by 'chrisdo' on Fri Feb 19 08:07:34 UTC 2010&lt;br /&gt;************************************************************/&lt;br /&gt;12/01/04 07:59:15 INFO namenode.FSNamesystem: fsOwner=hduser,hadoop,adm,dialout,fax,cdrom,floppy,tape,audio,dip,video,plugdev,fuse,lpadmin,netdev,admin,sambashare&lt;br /&gt;12/01/04 07:59:15 INFO namenode.FSNamesystem: supergroup=supergroup&lt;br /&gt;12/01/04 07:59:15 INFO namenode.FSNamesystem: isPermissionEnabled=true&lt;br /&gt;12/01/04 07:59:15 INFO common.Storage: Image file of size 96 saved in 0 seconds.&lt;br /&gt;12/01/04 07:59:15 INFO common.Storage: Storage directory /app/hadoop/tmp/dfs/name has been successfully formatted.&lt;br /&gt;12/01/04 07:59:15 INFO namenode.NameNode: SHUTDOWN_MSG:&lt;br /&gt;/************************************************************&lt;br /&gt;SHUTDOWN_MSG: Shutting down NameNode at bigdata1/172.20.10.92&lt;br /&gt;************************************************************/&lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Next, I started HDFS.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;hduser@bigdata1:/usr/local/hadoop/hadoop$ bin/start-dfs.sh&lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;It’s output was;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;starting namenode, logging to /usr/local/hadoop/hadoop/bin/../logs/hadoop-hduser-namenode-bigdata1.out&lt;br /&gt;bigdata2: starting datanode, logging to /usr/local/hadoop/hadoop/bin/../logs/hadoop-hduser-datanode-bigdata2.out&lt;br /&gt;bigdata3: starting datanode, logging to /usr/local/hadoop/hadoop/bin/../logs/hadoop-hduser-datanode-bigdata3.out&lt;br /&gt;bigdata4: starting datanode, logging to /usr/local/hadoop/hadoop/bin/../logs/hadoop-hduser-datanode-bigdata4.out&lt;br /&gt;bigdata1: starting secondarynamenode, logging to /usr/local/hadoop/hadoop/bin/../logs/hadoop-hduser-secondarynamenode-bigdata1.out&lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;I ran the HDFS Admin Report to see the status of my cluster.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;hduser@bigdata1:/usr/local/hadoop/hadoop$ bin/hadoop dfsadmin –report&lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;The report displays the following;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Configured Capacity: 206701436928 (192.51 GB)&lt;br /&gt;Present Capacity: 186873368576 (174.04 GB)&lt;br /&gt;DFS Remaining: 186873294848 (174.04 GB)&lt;br /&gt;DFS Used: 73728 (72 KB)&lt;br /&gt;DFS Used%: 0%&lt;br /&gt;Under replicated blocks: 0&lt;br /&gt;Blocks with corrupt replicas: 0&lt;br /&gt;Missing blocks: 0&lt;br /&gt;&lt;br /&gt;-------------------------------------------------&lt;br /&gt;Datanodes available: 3 (3 total, 0 dead)&lt;br /&gt;&lt;br /&gt;Name: 172.20.10.127:50010&lt;br /&gt;Decommission Status : Normal&lt;br /&gt;Configured Capacity: 68900478976 (64.17 GB)&lt;br /&gt;DFS Used: 24576 (24 KB)&lt;br /&gt;Non DFS Used: 6721228800 (6.26 GB)&lt;br /&gt;DFS Remaining: 62179225600(57.91 GB)&lt;br /&gt;DFS Used%: 0%&lt;br /&gt;DFS Remaining%: 90.24%&lt;br /&gt;Last contact: Wed Jan 04 08:00:20 EST 2012&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Name: 172.20.10.128:50010&lt;br /&gt;Decommission Status : Normal&lt;br /&gt;Configured Capacity: 68900478976 (64.17 GB)&lt;br /&gt;DFS Used: 24576 (24 KB)&lt;br /&gt;Non DFS Used: 6732939264 (6.27 GB)&lt;br /&gt;DFS Remaining: 62167515136(57.9 GB)&lt;br /&gt;DFS Used%: 0%&lt;br /&gt;DFS Remaining%: 90.23%&lt;br /&gt;Last contact: Wed Jan 04 08:00:20 EST 2012&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Name: 172.20.10.48:50010&lt;br /&gt;Decommission Status : Normal&lt;br /&gt;Configured Capacity: 68900478976 (64.17 GB)&lt;br /&gt;DFS Used: 24576 (24 KB)&lt;br /&gt;Non DFS Used: 6373900288 (5.94 GB)&lt;br /&gt;DFS Remaining: 62526554112(58.23 GB)&lt;br /&gt;DFS Used%: 0%&lt;br /&gt;DFS Remaining%: 90.75%&lt;br /&gt;Last contact: Wed Jan 04 08:00:17 EST 2012&lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;After this I started MapReduce.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;hduser@bigdata1:/usr/local/hadoop/hadoop$ bin/start-mapred.sh&lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;It’s output was this;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;starting jobtracker, logging to /usr/local/hadoop/hadoop/bin/../logs/hadoop-hduser-jobtracker-bigdata1.out&lt;br /&gt;bigdata3: starting tasktracker, logging to /usr/local/hadoop/hadoop/bin/../logs/hadoop-hduser-tasktracker-bigdata3.out&lt;br /&gt;bigdata2: starting tasktracker, logging to /usr/local/hadoop/hadoop/bin/../logs/hadoop-hduser-tasktracker-bigdata2.out&lt;br /&gt;bigdata4: starting tasktracker, logging to /usr/local/hadoop/hadoop/bin/../logs/hadoop-hduser-tasktracker-bigdata4.out&lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;Success!&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Now there are three web interface URLs that you can use to check up on your clusters health, there are;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;http://localhost:50030/ – web UI for MapReduce job tracker(s)&lt;br /&gt;http://localhost:50060/ – web UI for task tracker(s)&lt;br /&gt;http://localhost:50070/ – web UI for HDFS name node(s)&lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4103619847444885405-7471796942185338880?l=claysql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claysql.blogspot.com/feeds/7471796942185338880/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claysql.blogspot.com/2012/01/correcting-hadoops-hdfs.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/7471796942185338880'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/7471796942185338880'/><link rel='alternate' type='text/html' href='http://claysql.blogspot.com/2012/01/correcting-hadoops-hdfs.html' title='Correcting Hadoop&apos;s HDFS java.io.IOException Errors'/><author><name>Clay McDonald</name><uri>http://www.blogger.com/profile/00861387900854837549</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://1.bp.blogspot.com/_p-E9D6bFkUY/SaVuWj-vwYI/AAAAAAAAAAo/bZ0v1BRWtJE/S220/IMG00060.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103619847444885405.post-7275825756496065566</id><published>2011-06-29T08:38:00.000-07:00</published><updated>2011-06-29T08:39:55.148-07:00</updated><title type='text'></title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;img style="width: 200px; height: 180px;" src="http://4.bp.blogspot.com/-GEbMKL1Q-U0/TgtCSU6Nq8I/AAAAAAAAADs/CMvYEIfQplE/s400/SQLSATDC.jpg" alt="" id="BLOGGER_PHOTO_ID_5623661442320149442" border="0" /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;It's time again for SQL Saturday Washington DC!  With last year's event being such a huge success, this year's event will be even better! We are expecting over 250 attendees to show up for a full day of training from some of the best speakers in the SQL Server community.&lt;br /&gt;&lt;br /&gt;This is one event you don't want to miss! Everyone who attends will get a SQL    Saturday T-Shirt and lots of swag!  Free breakfast and lunch will be provided. We will have several SQL Server vendors that will be presenting the latest upgrades and solutions. And at the end of the day, we will be raffling off some awesome door prizes provided by our many sponsors!&lt;br /&gt;&lt;br /&gt;SQL Saturday is a FREE one day training events for SQL Server professionals. SQL Saturday was initially the idea of three DBAs that wanted a Code Camp style event just for SQL Server professionals. It began with the first SQL Saturday in Tampa, Florida. The event was such a huge success, more events followed. After over 40 successful events, The Professional Association for SQL Server took over the     administration of SQL   Saturday events.&lt;br /&gt;&lt;br /&gt;SQL Saturday events are usually divided into three tracks consisting of BI, Database Development, and Database Administration.  Typically there will be five sessions per track. SQL Saturday tries to recruit local SQL Server professionals to present at the event, but occasionally, more nationally known speakers may also present.&lt;br /&gt;&lt;br /&gt;SQL Saturday is all about sharing issues and solutions, and gaining knowledge that will make you a better SQL Server professional.&lt;br /&gt;&lt;br /&gt;We’ll see you there!!!&lt;br /&gt;&lt;br /&gt;Register at: &lt;!--[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:dontvertaligncellwithsp/&gt;    &lt;w:dontbreakconstrainedforcedtables/&gt;    &lt;w:dontvertalignintxbx/&gt;    &lt;w:word11kerningpairs/&gt;    &lt;w:cachedcolbalance/&gt;   &lt;/w:Compatibility&gt;   &lt;w:browserlevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val=""&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:narylim&gt;&lt;/m:intlim&gt; &lt;/m:wrapindent&gt;&lt;!--[endif]--&gt;&lt;!--[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]--&gt;&lt;!--[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-qformat:yes;  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-fareast-font-family:"Times New Roman";  mso-fareast-theme-font:minor-fareast;  mso-hansi-font-family:Calibri;  mso-hansi-theme-font:minor-latin;} &lt;/style&gt; &lt;![endif]--&gt;&lt;span style="font-size: 12pt; line-height: 115%; font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;;"&gt;&lt;a href="http://www.sqlsaturday.com/96/eventhome.aspx"&gt;&lt;span style="line-height: 115%;"&gt;http://www.sqlsaturday.com/96/eventhome.aspx&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;FOLLOW US!&lt;br /&gt;&lt;a href="http://www.facebook.com/#%21/home.php?sk=group_153896277973194"&gt;&lt;br /&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 40px; height: 40px;" src="http://3.bp.blogspot.com/-FKbI6Mbt1hs/TgtCWMLNFAI/AAAAAAAAAD0/zhO4tlb9ilU/s400/FB.jpeg" alt="" id="BLOGGER_PHOTO_ID_5623661508694971394" border="0" /&gt;&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/m:defjc&gt;&lt;/m:rmargin&gt;&lt;/m:lmargin&gt;&lt;/m:dispdef&gt;&lt;/m:smallfrac&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4103619847444885405-7275825756496065566?l=claysql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claysql.blogspot.com/feeds/7275825756496065566/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claysql.blogspot.com/2011/06/its-time-again-for-sql-saturday.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/7275825756496065566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/7275825756496065566'/><link rel='alternate' type='text/html' href='http://claysql.blogspot.com/2011/06/its-time-again-for-sql-saturday.html' title=''/><author><name>Clay McDonald</name><uri>http://www.blogger.com/profile/00861387900854837549</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://1.bp.blogspot.com/_p-E9D6bFkUY/SaVuWj-vwYI/AAAAAAAAAAo/bZ0v1BRWtJE/S220/IMG00060.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-GEbMKL1Q-U0/TgtCSU6Nq8I/AAAAAAAAADs/CMvYEIfQplE/s72-c/SQLSATDC.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103619847444885405.post-3267018144194814340</id><published>2011-06-10T11:37:00.000-07:00</published><updated>2011-06-10T11:45:47.052-07:00</updated><title type='text'>SQL Server: An error occurred while executing batch. Error message is: The directory name is invalid.</title><content type='html'>I logged onto the server this morning to delete some files because the disk had run out of free space. After deleting some files, I went to run some maintenance scripts in SSMS and received the following error:&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;An error occurred while executing batch. Error message is: The directory name is invalid.&lt;/span&gt;&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;After doing some online research, I found out that the reason for this error is because SQL Server cannot find the temp folder in which to store the query results. To correct this, try logging off and back on to the machine that you are running SSMS on. If the error persists, reboot the machine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4103619847444885405-3267018144194814340?l=claysql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claysql.blogspot.com/feeds/3267018144194814340/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claysql.blogspot.com/2011/06/sql-server-error-occurred-while.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/3267018144194814340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/3267018144194814340'/><link rel='alternate' type='text/html' href='http://claysql.blogspot.com/2011/06/sql-server-error-occurred-while.html' title='SQL Server: An error occurred while executing batch. Error message is: The directory name is invalid.'/><author><name>Clay McDonald</name><uri>http://www.blogger.com/profile/00861387900854837549</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://1.bp.blogspot.com/_p-E9D6bFkUY/SaVuWj-vwYI/AAAAAAAAAAo/bZ0v1BRWtJE/S220/IMG00060.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103619847444885405.post-3730048033819925291</id><published>2011-06-02T07:27:00.000-07:00</published><updated>2011-06-02T08:20:34.043-07:00</updated><title type='text'>Cannot edit job steps in SSMS 2008 R2</title><content type='html'>When attempting edit the job step, or view the job step details, I received the following error:&lt;span style="color: red;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Creating an instance of the COM component with CLSID {AA40D1D6-CAEF-4A56-B9BB-D0D3DC976BA2} from the IClassFactory failed due to the following error: c001f011. (Microsoft.SqlServer.ManagedDTS)&lt;/span&gt;&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;You may also get this error when attempting to create a new job step.&lt;br /&gt;&lt;br /&gt;I did a search and found several old post requesting help with the same problem. Microsoft corrected the problem with the last Hotfix; Cumulative Update package 7 for SQL Server 2008 R2.&lt;br /&gt;&lt;br /&gt;For more information on Cumulative Update package 7 for SQL Server 2008 R2 and how to download it, go here; http://support.microsoft.com/kb/2507770&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4103619847444885405-3730048033819925291?l=claysql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claysql.blogspot.com/feeds/3730048033819925291/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claysql.blogspot.com/2011/06/cannot-edit-job-steps-in-ssms-2008-r2.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/3730048033819925291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/3730048033819925291'/><link rel='alternate' type='text/html' href='http://claysql.blogspot.com/2011/06/cannot-edit-job-steps-in-ssms-2008-r2.html' title='Cannot edit job steps in SSMS 2008 R2'/><author><name>Clay McDonald</name><uri>http://www.blogger.com/profile/00861387900854837549</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://1.bp.blogspot.com/_p-E9D6bFkUY/SaVuWj-vwYI/AAAAAAAAAAo/bZ0v1BRWtJE/S220/IMG00060.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103619847444885405.post-7286824765793847520</id><published>2011-05-18T08:34:00.001-07:00</published><updated>2011-05-18T08:47:08.583-07:00</updated><title type='text'>MADExop: The Mid Atlantic Developer Expo in Hampton, VA June 30 - July 1, 2011</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/-4eLuI3ne7VA/TdPnVzOBsSI/AAAAAAAAADQ/bdUTPuZr7nU/s1600/MADExpoLogo1.png"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 133px;" src="http://2.bp.blogspot.com/-4eLuI3ne7VA/TdPnVzOBsSI/AAAAAAAAADQ/bdUTPuZr7nU/s400/MADExpoLogo1.png" alt="" id="BLOGGER_PHOTO_ID_5608080322718708002" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Ok, so I get an email from Andrew Duthie at Microsoft asking me to get the word out about the upcoming Mid Atlantic Developer Expo (MADExop) in Hampton, VA. Now this was the first time I had heard about it and really wanted go after I visited the website and read all the cool sessions they had lined up. But then, I saw that for only $20 you could bring your child for an all day kid geekout session! Now, what could be better? You go for two days of awesome and, did I mention cheep?, developer training from the best developers around and inspire your child to follow in your footsteps at the same time!&lt;br /&gt;&lt;br /&gt;Take a look at the lineups for Thursday and Friday sessions:&lt;br /&gt;&lt;a href="http://madexpo.us/images/Agenda_Thursday.pdf" target="_blank"&gt;Click here for a PDF of the Day 1 Agenda&lt;/a&gt;&lt;br /&gt;&lt;a href="http://madexpo.us/images/Agenda_Friday.pdf" target="_blank"&gt;Click here for a PDF of the Day 2 Agenda&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Register here!&lt;/span&gt;&lt;br /&gt;&lt;a href="http://madexpo2011-mcdonald.eventbrite.com/" target="_blank"&gt;MADExpo 2011 Registration!&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4103619847444885405-7286824765793847520?l=claysql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claysql.blogspot.com/feeds/7286824765793847520/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claysql.blogspot.com/2011/05/madexop-mid-atlantic-developer-expo-in.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/7286824765793847520'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/7286824765793847520'/><link rel='alternate' type='text/html' href='http://claysql.blogspot.com/2011/05/madexop-mid-atlantic-developer-expo-in.html' title='MADExop: The Mid Atlantic Developer Expo in Hampton, VA June 30 - July 1, 2011'/><author><name>Clay McDonald</name><uri>http://www.blogger.com/profile/00861387900854837549</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://1.bp.blogspot.com/_p-E9D6bFkUY/SaVuWj-vwYI/AAAAAAAAAAo/bZ0v1BRWtJE/S220/IMG00060.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-4eLuI3ne7VA/TdPnVzOBsSI/AAAAAAAAADQ/bdUTPuZr7nU/s72-c/MADExpoLogo1.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103619847444885405.post-7541646090943793663</id><published>2011-05-12T09:59:00.000-07:00</published><updated>2011-06-02T08:34:52.089-07:00</updated><title type='text'>Idera's SQLsafe Restore Error "too recent to apply to the database"</title><content type='html'>&lt;span style="color: rgb(0, 0, 0);"&gt;    Last week, my manager came to me and asked if I could perform our first restore since installing the new SQLsafe Backup and Recovery software.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;  &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Because I was the one that pushed for SQLsafe to take over as our Backup and Recovery solution for all production SQL Servers, I was more than happy to show off SQLsafe's ease of use in restoring databases. I select the point in time that I wanted to restore to and clicked NEXT. &lt;/span&gt;  &lt;p style="color: rgb(0, 0, 0);" class="MsoNormal"&gt;I was expecting for the database to be restored in no time, but instead, and with horror written all over my face, I received the following error message in the "Result Text" with a BIG RED "&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Error&lt;/span&gt;" Progress indicator next to my Restore status.&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0);" class="MsoNormal"&gt;-------------------------------------------- snip -------------------------------------------&lt;br /&gt;&lt;/p&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold;font-size:85%;" &gt;&lt;span style="font-style: italic;"&gt;&amp;lt;!--[if gte mso 9]&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;xml&gt;&lt;span style="color: rgb(51, 51, 51); font-weight: bold;font-size:85%;" &gt;&lt;span style="font-style: italic;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;w:worddocument&gt;   &lt;span style="color: rgb(51, 51, 51); font-weight: bold;font-size:85%;" &gt;&lt;w:view style="font-style: italic;"&gt;Normal&lt;/w:view&gt;&lt;span style="font-style: italic;"&gt;   &lt;/span&gt;&lt;w:zoom style="font-style: italic;"&gt;0&lt;/w:zoom&gt;&lt;span style="font-style: italic;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;w:trackmoves&gt;   &lt;w:trackformatting&gt;   &lt;w:punctuationkerning&gt;   &lt;w:validateagainstschemas&gt;   &lt;span style="color: rgb(51, 51, 51); font-weight: bold;font-size:85%;" &gt;&lt;w:saveifxmlinvalid style="font-style: italic;"&gt;false&lt;/w:saveifxmlinvalid&gt;&lt;span style="font-style: italic;"&gt;   &lt;/span&gt;&lt;w:ignoremixedcontent style="font-style: italic;"&gt;false&lt;/w:ignoremixedcontent&gt;&lt;span style="font-style: italic;"&gt;   &lt;/span&gt;&lt;w:alwaysshowplaceholdertext style="font-style: italic;"&gt;false&lt;/w:alwaysshowplaceholdertext&gt;&lt;span style="font-style: italic;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;w:donotpromoteqf&gt;   &lt;span style="color: rgb(51, 51, 51); font-weight: bold;font-size:85%;" &gt;&lt;w:lidthemeother style="font-style: italic;"&gt;EN-US&lt;/w:lidthemeother&gt;&lt;span style="font-style: italic;"&gt;   &lt;/span&gt;&lt;w:lidthemeasian style="font-style: italic;"&gt;X-NONE&lt;/w:lidthemeasian&gt;&lt;span style="font-style: italic;"&gt;   &lt;/span&gt;&lt;w:lidthemecomplexscript style="font-style: italic;"&gt;X-NONE&lt;/w:lidthemecomplexscript&gt;&lt;/span&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:dontvertaligncellwithsp&gt;    &lt;w:dontbreakconstrainedforcedtables&gt;    &lt;w:dontvertalignintxbx&gt;    &lt;w:word11kerningpairs&gt;    &lt;span style="color: rgb(51, 51, 51); font-weight: bold;font-size:85%;" &gt;&lt;w:cachedcolbalance style="font-style: italic;"&gt;   &lt;/w:cachedcolbalance&gt;&lt;/span&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val=""&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;span style="color: rgb(51, 51, 51); font-weight: bold;font-size:85%;" &gt;&lt;m:wrapindent style="font-style: italic;" val="1440"&gt;    &lt;m:intlim val="subSup"&gt;    &lt;m:narylim val="undOvr"&gt;   &lt;/m:narylim&gt;&lt;/m:intlim&gt; &lt;/m:wrapindent&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;!----&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 style="font-style: italic;" locked="false" priority="37" name="Bibliography"&gt;   &lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:lsdexception&gt; &lt;/w:lsdexception&gt;&lt;!--[endif]--&gt;&lt;!----&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-qformat:yes;  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-fareast-font-family:"Times New Roman";  mso-fareast-theme-font:minor-fareast;  mso-hansi-font-family:Calibri;  mso-hansi-theme-font:minor-latin;} &lt;/style&gt; &lt;!--[endif]--&gt;  &lt;p style="color: rgb(51, 51, 51); font-style: italic; font-weight: bold;" class="MsoNormal" face="verdana"&gt;" Server instance: INSTANCE/NAME, Database: mas500_pl&lt;/p&gt;  &lt;p style="color: rgb(51, 51, 51); font-style: italic; font-weight: bold;" class="MsoNormal" face="verdana"&gt;The log in this backup set begins at LSN 94000000227900001, which is too recent to apply to the database. An earlier log backup that includes LSN 94000000221200001 can be restored.&lt;/p&gt;  &lt;p style="color: rgb(51, 51, 51); font-style: italic; font-weight: bold;" class="MsoNormal" face="verdana"&gt;RESTORE LOG is terminating abnormally."&lt;/p&gt;&lt;p style="font-family: verdana;" class="MsoNormal"&gt;&lt;!----&gt;&lt;xml&gt;  &lt;w:worddocument&gt;   &lt;w:view style="font-style: italic;"&gt;Normal&lt;/w:view&gt;&lt;span style="font-style: italic;"&gt;   &lt;/span&gt;&lt;w:zoom style="font-style: italic;"&gt;0&lt;/w:zoom&gt;&lt;span style="font-style: italic;"&gt;   &lt;/span&gt;&lt;w:trackmoves&gt;   &lt;w:trackformatting&gt;   &lt;w:punctuationkerning&gt;   &lt;w:validateagainstschemas&gt;   &lt;w:saveifxmlinvalid style="font-style: italic;"&gt;false&lt;/w:saveifxmlinvalid&gt;&lt;span style="font-style: italic;"&gt;   &lt;/span&gt;&lt;w:ignoremixedcontent style="font-style: italic;"&gt;false&lt;/w:ignoremixedcontent&gt;&lt;span style="font-style: italic;"&gt;   &lt;/span&gt;&lt;w:alwaysshowplaceholdertext style="font-style: italic;"&gt;false&lt;/w:alwaysshowplaceholdertext&gt;&lt;span style="font-style: italic;"&gt;   &lt;/span&gt;&lt;w:donotpromoteqf&gt;   &lt;w:lidthemeother style="font-style: italic;"&gt;EN-US&lt;/w:lidthemeother&gt;&lt;span style="font-style: italic;"&gt;   &lt;/span&gt;&lt;w:lidthemeasian style="font-style: italic;"&gt;X-NONE&lt;/w:lidthemeasian&gt;&lt;span style="font-style: italic;"&gt;   &lt;/span&gt;&lt;w:lidthemecomplexscript style="font-style: italic;"&gt;X-NONE&lt;/w:lidthemecomplexscript&gt;&lt;/w:donotpromoteqf&gt;&lt;/w:validateagainstschemas&gt;&lt;/w:punctuationkerning&gt;&lt;/w:trackformatting&gt;&lt;/w:trackmoves&gt;&lt;/w:worddocument&gt;&lt;/xml&gt;&lt;/p&gt;&lt;p style="font-family: verdana;" class="MsoNormal"&gt;--------------------------------------------------------------------------------------------&lt;br /&gt;&lt;xml&gt;&lt;w:worddocument&gt;&lt;w:trackmoves&gt;&lt;w:trackformatting&gt;&lt;w:punctuationkerning&gt;&lt;w:validateagainstschemas&gt;&lt;w:donotpromoteqf&gt;&lt;w:lidthemecomplexscript style="font-style: italic;"&gt;&lt;/w:lidthemecomplexscript&gt;&lt;/w:donotpromoteqf&gt;&lt;/w:validateagainstschemas&gt;&lt;/w:punctuationkerning&gt;&lt;/w:trackformatting&gt;&lt;/w:trackmoves&gt;&lt;/w:worddocument&gt;&lt;/xml&gt;&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0);" class="MsoNormal"&gt;With embarrassment, I turned to my manager and told him that I would call Idera's support staff and get help with restoring the database. I called the support number and got routed to a voice mailbox. However, within just a few minutes, I got a call back from Carl at Idera's Customer Support. I explained to him the issue I was having and after some brief research on his part, he said based on the message I was receiving that it looked like another backup had been done and that the SQLsafe backup that I was attempting to use was not the most current. &lt;/p&gt;  &lt;p style="color: rgb(0, 0, 0);" class="MsoNormal"&gt;I then opened SSMS and started the restore database wizard. I selected the database that I wanted to restore and then clicked file and add to browse to the folder. Then SURPRISE! The default backup folder appeared with recent backups of the database that I was attempting to restore.&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0);" class="MsoNormal"&gt;I then clicked on the SQL Server Agent and found a Full Backup job scheduled to run every Sunday at 2:00 am which was after the SQLsafe Full backups. &lt;/p&gt; &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/-AD8QAUc2ACo/TcwSimyZPUI/AAAAAAAAADI/1SeTpG2vyxQ/s1600/MAS500_Native_Backups.bmp"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 283px; height: 400px;" src="http://2.bp.blogspot.com/-AD8QAUc2ACo/TcwSimyZPUI/AAAAAAAAADI/1SeTpG2vyxQ/s400/MAS500_Native_Backups.bmp" alt="" id="BLOGGER_PHOTO_ID_5605876021906193730" border="0" /&gt;&lt;/a&gt;&lt;!----&gt;&lt;xml&gt; &lt;w:worddocument&gt;&lt;w:view&gt;&lt;/w:view&gt;&lt;w:trackmoves&gt;&lt;w:trackformatting&gt;&lt;w:punctuationkerning&gt;&lt;w:validateagainstschemas&gt;&lt;w:donotpromoteqf&gt;&lt;w:lidthemecomplexscript&gt;&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:dontvertaligncellwithsp&gt;    &lt;w:dontbreakconstrainedforcedtables&gt;    &lt;w:dontvertalignintxbx&gt;    &lt;w:word11kerningpairs&gt;    &lt;w:cachedcolbalance&gt;   &lt;/w:cachedcolbalance&gt;   &lt;m:mathpr&gt;    &lt;m:mathfont val="Cambria Math"&gt;    &lt;m:brkbin val="before"&gt;    &lt;m:brkbinsub val=""&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:narylim&gt;&lt;/m:intlim&gt; &lt;/m:wrapindent&gt;&lt;!--[endif]--&gt;&lt;!----&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&gt;&lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 5"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 6"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 7"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 8"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="9" qformat="true" name="heading 9"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="39" name="toc 1"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="39" name="toc 2"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="39" name="toc 3"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="39" name="toc 4"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="39" name="toc 5"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="39" name="toc 6"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="39" name="toc 7"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="39" name="toc 8"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="39" name="toc 9"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="35" qformat="true" name="caption"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="10" semihidden="false" unhidewhenused="false" qformat="true" name="Title"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="1" name="Default Paragraph Font"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="11" semihidden="false" unhidewhenused="false" qformat="true" name="Subtitle"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="22" semihidden="false" unhidewhenused="false" qformat="true" name="Strong"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="20" semihidden="false" unhidewhenused="false" qformat="true" name="Emphasis"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="59" semihidden="false" unhidewhenused="false" name="Table Grid"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" unhidewhenused="false" name="Placeholder Text"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="1" semihidden="false" unhidewhenused="false" qformat="true" name="No Spacing"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 1"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 1"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 1"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 1"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 1"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 1"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" unhidewhenused="false" name="Revision"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="34" semihidden="false" unhidewhenused="false" qformat="true" name="List Paragraph"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="29" semihidden="false" unhidewhenused="false" qformat="true" name="Quote"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="30" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Quote"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 1"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 1"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 1"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 1"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 1"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 1"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 1"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 1"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 2"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 2"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 2"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 2"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 2"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 2"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 2"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 2"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 2"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 2"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 2"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 2"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 2"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 2"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 3"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 3"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 3"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 3"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 3"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 3"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 3"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 3"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 3"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 3"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 3"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 3"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 3"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 3"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 4"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 4"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 4"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 4"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 4"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 4"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 4"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 4"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 4"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 4"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 4"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 4"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 4"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 4"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 5"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 5"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 5"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 5"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 5"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 5"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 5"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 5"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 5"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 5"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 5"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 5"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 5"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 5"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="60" semihidden="false" unhidewhenused="false" name="Light Shading Accent 6"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="61" semihidden="false" unhidewhenused="false" name="Light List Accent 6"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="62" semihidden="false" unhidewhenused="false" name="Light Grid Accent 6"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="63" semihidden="false" unhidewhenused="false" name="Medium Shading 1 Accent 6"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="64" semihidden="false" unhidewhenused="false" name="Medium Shading 2 Accent 6"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="65" semihidden="false" unhidewhenused="false" name="Medium List 1 Accent 6"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="66" semihidden="false" unhidewhenused="false" name="Medium List 2 Accent 6"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="67" semihidden="false" unhidewhenused="false" name="Medium Grid 1 Accent 6"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="68" semihidden="false" unhidewhenused="false" name="Medium Grid 2 Accent 6"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="69" semihidden="false" unhidewhenused="false" name="Medium Grid 3 Accent 6"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="70" semihidden="false" unhidewhenused="false" name="Dark List Accent 6"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="71" semihidden="false" unhidewhenused="false" name="Colorful Shading Accent 6"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="72" semihidden="false" unhidewhenused="false" name="Colorful List Accent 6"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="73" semihidden="false" unhidewhenused="false" name="Colorful Grid Accent 6"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="19" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Emphasis"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="21" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Emphasis"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="31" semihidden="false" unhidewhenused="false" qformat="true" name="Subtle Reference"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="32" semihidden="false" unhidewhenused="false" qformat="true" name="Intense Reference"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="33" semihidden="false" unhidewhenused="false" qformat="true" name="Book Title"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="37" name="Bibliography"&gt;   &lt;/w:lsdexception&gt;&lt;w:lsdexception locked="false" priority="39" qformat="true" name="TOC Heading"&gt;  &lt;/w:lsdexception&gt; &lt;/w:lsdexception&gt;&lt;!--[endif]--&gt;&lt;!----&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-qformat:yes;  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-fareast-font-family:"Times New Roman";  mso-fareast-theme-font:minor-fareast;  mso-hansi-font-family:Calibri;  mso-hansi-theme-font:minor-latin;} &lt;/style&gt; &lt;!--[endif]--&gt;  &lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:latentstyles&gt;&lt;/xml&gt;&lt;/m:defjc&gt;&lt;/m:rmargin&gt;&lt;/m:lmargin&gt;&lt;/m:dispdef&gt;&lt;/m:smallfrac&gt;&lt;/m:brkbinsub&gt;&lt;/m:brkbin&gt;&lt;/m:mathfont&gt;&lt;/m:mathpr&gt;&lt;/w:word11kerningpairs&gt;&lt;/w:dontvertalignintxbx&gt;&lt;/w:dontbreakconstrainedforcedtables&gt;&lt;/w:dontvertaligncellwithsp&gt;&lt;/w:splitpgbreakandparamark&gt;&lt;/w:dontgrowautofit&gt;&lt;/w:useasianbreakrules&gt;&lt;/w:wraptextwithpunct&gt;&lt;/w:snaptogridincell&gt;&lt;/w:breakwrappedtables&gt;&lt;/w:compatibility&gt;&lt;/w:donotpromoteqf&gt;&lt;/w:validateagainstschemas&gt;&lt;/w:punctuationkerning&gt;&lt;/w:trackformatting&gt;&lt;/w:trackmoves&gt;&lt;/w:worddocument&gt;&lt;/xml&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;p&gt;&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0);" class="MsoNormal"&gt;To restore the database, I first had to restore the native Full backup from Sunday morning with the following sql script;&lt;/p&gt;  &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal; font-style: italic; color: rgb(51, 51, 51);font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;RESTORE DATABASE&lt;/span&gt; [mas500_pl]&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal; font-style: italic; color: rgb(51, 51, 51);font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;FROM  DISK&lt;/span&gt; = &lt;span style="color: rgb(255, 0, 0);"&gt;N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\BACKUP\mas500_pl_db_201105010200.BAK' &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal; font-style: italic; color: rgb(51, 51, 51);font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;WITH  FILE&lt;/span&gt; = 1,  &lt;span style="color: rgb(51, 51, 255);"&gt;NORECOVERY&lt;/span&gt;,  &lt;span style="color: rgb(51, 51, 255);"&gt;NOUNLOAD&lt;/span&gt;,  &lt;span style="color: rgb(0, 153, 0);"&gt;STATS&lt;/span&gt; = 10&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal; font-style: italic; color: rgb(51, 51, 255);font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;GO&lt;/span&gt;&lt;/p&gt;  &lt;p style="color: rgb(0, 0, 0);" class="MsoNormal"&gt; Next I opened SQLsafe and restored each Differential, one at a time, with "&lt;span style="font-weight: bold;"&gt;Force restore&lt;/span&gt;", "&lt;span style="font-weight: bold;"&gt;Ingnore Checksum Errors&lt;/span&gt;", and with non-recovery, "&lt;span style="font-weight: bold;"&gt;Not accessible&lt;/span&gt;", until the last Differential. For the last Differential, I restored it with recovery or "&lt;span style="font-weight: bold;"&gt;Fully accessible&lt;/span&gt;".&lt;/p&gt;  &lt;p style="color: rgb(0, 0, 0);" class="MsoNormal"&gt;So a BIG Thank You goes out to Carl at Idera's Customer Support!&lt;/p&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:lsdexception&gt;&lt;/w:latentstyles&gt;&lt;/xml&gt;&lt;/m:defjc&gt;&lt;/m:rmargin&gt;&lt;/m:lmargin&gt;&lt;/m:dispdef&gt;&lt;/m:smallfrac&gt;&lt;/m:brkbinsub&gt;&lt;/m:brkbin&gt;&lt;/m:mathfont&gt;&lt;/m:mathpr&gt;&lt;/w:word11kerningpairs&gt;&lt;/w:dontvertalignintxbx&gt;&lt;/w:dontbreakconstrainedforcedtables&gt;&lt;/w:dontvertaligncellwithsp&gt;&lt;/w:splitpgbreakandparamark&gt;&lt;/w:dontgrowautofit&gt;&lt;/w:useasianbreakrules&gt;&lt;/w:wraptextwithpunct&gt;&lt;/w:snaptogridincell&gt;&lt;/w:breakwrappedtables&gt;&lt;/w:compatibility&gt;&lt;/w:donotpromoteqf&gt;&lt;/w:validateagainstschemas&gt;&lt;/w:punctuationkerning&gt;&lt;/w:trackformatting&gt;&lt;/w:trackmoves&gt;&lt;/w:worddocument&gt;&lt;/xml&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4103619847444885405-7541646090943793663?l=claysql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claysql.blogspot.com/feeds/7541646090943793663/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claysql.blogspot.com/2011/05/ideras-sqlsafe-restore-error-too-recent.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/7541646090943793663'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/7541646090943793663'/><link rel='alternate' type='text/html' href='http://claysql.blogspot.com/2011/05/ideras-sqlsafe-restore-error-too-recent.html' title='Idera&apos;s SQLsafe Restore Error &quot;too recent to apply to the database&quot;'/><author><name>Clay McDonald</name><uri>http://www.blogger.com/profile/00861387900854837549</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://1.bp.blogspot.com/_p-E9D6bFkUY/SaVuWj-vwYI/AAAAAAAAAAo/bZ0v1BRWtJE/S220/IMG00060.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-AD8QAUc2ACo/TcwSimyZPUI/AAAAAAAAADI/1SeTpG2vyxQ/s72-c/MAS500_Native_Backups.bmp' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103619847444885405.post-7616002393826103286</id><published>2010-11-12T19:03:00.001-08:00</published><updated>2010-11-12T19:03:01.643-08:00</updated><title type='text'>PASS Summit 2010 Keynote David DeWitt</title><content type='html'>This was the best presentation during all of PASS Summit 2010. Everyone enjoyed Dr. DeWitt's keynote session on SQL Query Optimization.&lt;div style="width:425px" id="__ss_5741989"&gt;&lt;strong style="display:block;margin:12px 0 4px"&gt;&lt;a href="http://www.slideshare.net/GraySystemsLab/pass-summit-2010-keynote-david-dewitt" title="PASS Summit 2010 Keynote David DeWitt"&gt;PASS Summit 2010 Keynote David DeWitt&lt;/a&gt;&lt;/strong&gt;&lt;object id="__sse5741989" width="425" height="355"&gt;&lt;param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=pass2010finalfull-101111074859-phpapp02&amp;stripped_title=pass-summit-2010-keynote-david-dewitt&amp;userName=GraySystemsLab" /&gt;&lt;param name="allowFullScreen" value="true"/&gt;&lt;param name="allowScriptAccess" value="always"/&gt;&lt;embed name="__sse5741989" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=pass2010finalfull-101111074859-phpapp02&amp;stripped_title=pass-summit-2010-keynote-david-dewitt&amp;userName=GraySystemsLab" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style="padding:5px 0 12px"&gt;View more &lt;a href="http://www.slideshare.net/"&gt;presentations&lt;/a&gt; from &lt;a href="http://www.slideshare.net/GraySystemsLab"&gt;GraySystemsLab&lt;/a&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/4103619847444885405-7616002393826103286?l=claysql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claysql.blogspot.com/feeds/7616002393826103286/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claysql.blogspot.com/2010/11/pass-summit-2010-keynote-david-dewitt.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/7616002393826103286'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/7616002393826103286'/><link rel='alternate' type='text/html' href='http://claysql.blogspot.com/2010/11/pass-summit-2010-keynote-david-dewitt.html' title='PASS Summit 2010 Keynote David DeWitt'/><author><name>Clay McDonald</name><uri>http://www.blogger.com/profile/00861387900854837549</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://1.bp.blogspot.com/_p-E9D6bFkUY/SaVuWj-vwYI/AAAAAAAAAAo/bZ0v1BRWtJE/S220/IMG00060.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103619847444885405.post-3217024900859022990</id><published>2010-06-10T09:22:00.000-07:00</published><updated>2011-10-09T05:34:32.664-07:00</updated><title type='text'>SQL Server Row Counts in Properties Are Wrong!</title><content type='html'>One of my users came to me and asked why the row count in the table properties was different from the SELECT COUNT(1) from the table. This was a database that was sent to us from a different company and attached to our server. The first question for me was; where does row count in properties come from in SQL Server? As it turns out, it gets this count from the sysindexes table which we can see from the following;&lt;br /&gt;&lt;br /&gt;&lt;code  style="font-size:12px;"&gt;&lt;span style="color:blue;"&gt;&lt;em&gt;USE &lt;/em&gt;&lt;/span&gt;&lt;em&gt;&lt;span style="color:black;"&gt;DatabaseName&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;SELECT &lt;/span&gt;&lt;/em&gt;&lt;em&gt;&lt;span style="color:black;"&gt;rowcnt&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;FROM &lt;/span&gt;&lt;/em&gt;&lt;em&gt;&lt;span style="color:black;"&gt;dbo.sysindexes&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;WHERE &lt;/span&gt;&lt;span style="color:magenta;"&gt;OBJECT_NAME&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:black;"&gt;id&lt;/span&gt;&lt;span style="color:gray;"&gt;)&lt;/span&gt;&lt;span style="color:#000000;"&gt; =&lt;/span&gt;&lt;span style="color:blue;"&gt; &lt;/span&gt;&lt;/em&gt;&lt;em&gt;&lt;span style="color:red;"&gt;'TableName'&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;span style="color:black;"&gt;&lt;em&gt;&lt;span style="color:#3333ff;"&gt;GO&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;span style="color:green;"&gt;&lt;em&gt;-- Returns &lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;span style="color:black;"&gt;&lt;em&gt;330013&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;A count of the table results in the following;&lt;br /&gt;&lt;br /&gt;&lt;code  style="font-size:12px;"&gt;&lt;span style="color:blue;"&gt;&lt;em&gt;USE &lt;/em&gt;&lt;/span&gt;&lt;em&gt;&lt;span style="color:black;"&gt;DatabaseName&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;SELECT &lt;/span&gt;&lt;span style="color:magenta;"&gt;COUNT&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:black;"&gt;1&lt;/span&gt;&lt;span style="color:gray;"&gt;) &lt;/span&gt;&lt;span style="color:blue;"&gt;AS &lt;/span&gt;&lt;/em&gt;&lt;em&gt;&lt;span style="color:black;"&gt;CNT&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;FROM &lt;/span&gt;&lt;/em&gt;&lt;span style="color:black;"&gt;&lt;em&gt;dbo.TableName&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;span style="color:green;"&gt;&lt;em&gt;-- Returns &lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;span style="color:black;"&gt;&lt;em&gt;331882&lt;br /&gt;&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To update the sysindexes table with the correct row counts, we run the following DBCC;&lt;br /&gt;&lt;br /&gt;&lt;code  style="font-size:12px;"&gt;&lt;span style="color:blue;"&gt;&lt;em&gt;USE &lt;/em&gt;&lt;/span&gt;&lt;em&gt;&lt;span style="color:black;"&gt;DatabaseName&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;GO&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;DBCC &lt;/span&gt;&lt;span style="color:black;"&gt;UPDATEUSAGE&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:black;"&gt;0&lt;/span&gt;&lt;span style="color:gray;"&gt;) &lt;/span&gt;&lt;span style="color:blue;"&gt;WITH &lt;/span&gt;&lt;span style="color:#3333ff;"&gt;COUNT_ROWS&lt;/span&gt;&lt;/em&gt;&lt;span style="color:gray;"&gt;&lt;em&gt;;&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;span style="color:black;"&gt;&lt;em&gt;&lt;span style="color:#3333ff;"&gt;GO &lt;/span&gt;&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;/code&gt;&lt;br /&gt;Now when we run our queries again, we get the following;&lt;br /&gt;&lt;br /&gt;&lt;code  style="font-size:12px;"&gt;&lt;span style="color:blue;"&gt;&lt;em&gt;USE &lt;/em&gt;&lt;/span&gt;&lt;span style="color:black;"&gt;&lt;em&gt;DatabaseName&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;em&gt;&lt;span style="color:#3333ff;"&gt;GO&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;SELECT &lt;/span&gt;&lt;/em&gt;&lt;em&gt;&lt;span style="color:black;"&gt;rowcnt&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;FROM &lt;/span&gt;&lt;/em&gt;&lt;em&gt;&lt;span style="color:black;"&gt;dbo.sysindexes&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;WHERE &lt;/span&gt;&lt;span style="color:magenta;"&gt;OBJECT_NAME&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:black;"&gt;id&lt;/span&gt;&lt;span style="color:gray;"&gt;) &lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span style="color:#000000;"&gt;=&lt;/span&gt; &lt;/span&gt;&lt;/em&gt;&lt;em&gt;&lt;span style="color:red;"&gt;'TableName '&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;em&gt;&lt;span style="color:black;"&gt;&lt;span style="color:#3333ff;"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;SELECT &lt;/span&gt;&lt;span style="color:magenta;"&gt;COUNT&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:black;"&gt;1&lt;/span&gt;&lt;span style="color:gray;"&gt;) &lt;/span&gt;&lt;span style="color:blue;"&gt;AS &lt;/span&gt;&lt;/em&gt;&lt;em&gt;&lt;span style="color:black;"&gt;CNT&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;FROM &lt;/span&gt;&lt;/em&gt;&lt;em&gt;&lt;span style="color:black;"&gt;dbo.TableName&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:green;"&gt;-- Returns &lt;/span&gt;&lt;/em&gt;&lt;span style="color:black;"&gt;&lt;em&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;331882&lt;/span&gt;&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;span style="color:green;"&gt;&lt;em&gt;-- Returns &lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;span style="color:black;"&gt;&lt;em&gt;331882&lt;br /&gt;&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4103619847444885405-3217024900859022990?l=claysql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claysql.blogspot.com/feeds/3217024900859022990/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claysql.blogspot.com/2010/06/sql-server-row-counts-in-properties-are.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/3217024900859022990'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/3217024900859022990'/><link rel='alternate' type='text/html' href='http://claysql.blogspot.com/2010/06/sql-server-row-counts-in-properties-are.html' title='SQL Server Row Counts in Properties Are Wrong!'/><author><name>Clay McDonald</name><uri>http://www.blogger.com/profile/00861387900854837549</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://1.bp.blogspot.com/_p-E9D6bFkUY/SaVuWj-vwYI/AAAAAAAAAAo/bZ0v1BRWtJE/S220/IMG00060.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103619847444885405.post-4623152585248431397</id><published>2010-05-24T08:43:00.000-07:00</published><updated>2010-05-24T09:04:11.819-07:00</updated><title type='text'>Cast Scientific Notation as Money or Varchar</title><content type='html'>I run into Scientific Notation on occasion and always refer back to my TSQL scripts folder. Most of the time, I'll have a column where about 50% of the rows contain Scientific Notation. In these cases, I use a CASE statement.&lt;br /&gt;&lt;br /&gt;First, CAST as VARCHAR:&lt;br /&gt;&lt;br /&gt;&lt;code  style="font-size:12px;"&gt;&lt;span style="color:magenta;"&gt;LTRIM&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:magenta;"&gt;RTRIM&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:magenta;"&gt;CAST&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:magenta;"&gt;CAST&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:red;"&gt;'2.50823E+12' &lt;/span&gt;&lt;span style="color:blue;"&gt;AS &lt;/span&gt;&lt;span style="color:black;"&gt;FLOAT&lt;/span&gt;&lt;span style="color:gray;"&gt;) &lt;/span&gt;&lt;span style="color:blue;"&gt;AS NVARCHAR&lt;/span&gt;&lt;span style="color:gray;"&gt;))) &lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Second, CAST as MONEY:&lt;br /&gt;&lt;br /&gt;&lt;code  style="font-size:12px;"&gt;&lt;span style="color:magenta;"&gt;LTRIM&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:magenta;"&gt;RTRIM&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:magenta;"&gt;CAST&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:magenta;"&gt;CAST&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:magenta;"&gt;CAST&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:red;"&gt;'2.50823E+12' &lt;/span&gt;&lt;span style="color:blue;"&gt;AS &lt;/span&gt;&lt;span style="color:black;"&gt;FLOAT&lt;/span&gt;&lt;span style="color:gray;"&gt;) &lt;/span&gt;&lt;span style="color:blue;"&gt;AS NVARCHAR&lt;/span&gt;&lt;span style="color:gray;"&gt;)&lt;/span&gt;&lt;span style="color:blue;"&gt;AS &lt;/span&gt;&lt;span style="color:black;"&gt;MONEY&lt;/span&gt;&lt;span style="color:gray;"&gt;)))  &lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now, let's see this in a CASE statement:&lt;br /&gt;&lt;br /&gt;&lt;code  style="font-size:12px;"&gt;&lt;span style="color:gray;"&gt;,&lt;/span&gt;&lt;span style="color:magenta;"&gt;&lt;span style="color:#3333ff;"&gt;CASE&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;WHEN &lt;/span&gt;&lt;span style="color:black;"&gt;[AMOUNT] &lt;/span&gt;&lt;span style="color:gray;"&gt;LIKE &lt;/span&gt;&lt;span style="color:red;"&gt;'%E-%' &lt;/span&gt;&lt;span style="color:blue;"&gt;THEN &lt;/span&gt;&lt;span style="color:magenta;"&gt;LTRIM&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:magenta;"&gt;RTRIM&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:magenta;"&gt;CAST&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:magenta;"&gt;CAST&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:magenta;"&gt;CAST&lt;/span&gt;&lt;span style="color:gray;"&gt;(&lt;/span&gt;&lt;span style="color:black;"&gt;[AMOUNT]&lt;/span&gt;&lt;span style="color:blue;"&gt;AS &lt;/span&gt;&lt;span style="color:black;"&gt;FLOAT&lt;/span&gt;&lt;span style="color:gray;"&gt;) &lt;/span&gt;&lt;span style="color:blue;"&gt;AS NVARCHAR&lt;/span&gt;&lt;span style="color:gray;"&gt;)&lt;/span&gt;&lt;span style="color:blue;"&gt;AS &lt;/span&gt;&lt;span style="color:black;"&gt;MONEY&lt;/span&gt;&lt;span style="color:gray;"&gt;)))&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;WHEN &lt;/span&gt;&lt;span style="color:black;"&gt;[AMOUNT] &lt;/span&gt;&lt;span style="color:blue;"&gt;= &lt;/span&gt;&lt;span style="color:red;"&gt;' ' &lt;/span&gt;&lt;span style="color:blue;"&gt;THEN &lt;/span&gt;&lt;span style="color:gray;"&gt;NULL&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;ELSE &lt;/span&gt;&lt;span style="color:black;"&gt;[AMOUNT]&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;END AS &lt;/span&gt;&lt;span style="color:black;"&gt;[AMOUNT]&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4103619847444885405-4623152585248431397?l=claysql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claysql.blogspot.com/feeds/4623152585248431397/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claysql.blogspot.com/2010/05/cast-scientific-notation-as-money-or.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/4623152585248431397'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/4623152585248431397'/><link rel='alternate' type='text/html' href='http://claysql.blogspot.com/2010/05/cast-scientific-notation-as-money-or.html' title='Cast Scientific Notation as Money or Varchar'/><author><name>Clay McDonald</name><uri>http://www.blogger.com/profile/00861387900854837549</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://1.bp.blogspot.com/_p-E9D6bFkUY/SaVuWj-vwYI/AAAAAAAAAAo/bZ0v1BRWtJE/S220/IMG00060.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103619847444885405.post-8975733767520208076</id><published>2010-04-14T09:15:00.000-07:00</published><updated>2010-04-14T09:20:10.144-07:00</updated><title type='text'>CHECKDB - A severe error occurred on the current command. The results, if any, should be discarded.</title><content type='html'>CHECKDB found 0 allocation errors and 0 consistency errors in database&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;Msg 0, Level 11, State 0, Line 0&lt;br /&gt;A severe error occurred on the current command.  The results, if any, should be discarded.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I ran into a case where I had corrupted pages in my database. I had previously had this database on a SQL Server 2005 instance. When I ran CHECKDB in SSMS 2005, it returned info messages detailing the consistency errors. However, after restoring the database on a 2008 instance and running CHECKDB in SSMS 2008, I received the message above. At first, you get this, “What now!” feeling. Don't panic. If you go to the SQL error log, you’ll see the CHECKDB results. Be sure that you are running CHECKDB with the &lt;span style="color:#3333ff;"&gt;WITH ALL_ERRORMSGS&lt;/span&gt; option.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4103619847444885405-8975733767520208076?l=claysql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claysql.blogspot.com/feeds/8975733767520208076/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claysql.blogspot.com/2010/04/checkdb-severe-error-occurred-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/8975733767520208076'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/8975733767520208076'/><link rel='alternate' type='text/html' href='http://claysql.blogspot.com/2010/04/checkdb-severe-error-occurred-on.html' title='CHECKDB - A severe error occurred on the current command. The results, if any, should be discarded.'/><author><name>Clay McDonald</name><uri>http://www.blogger.com/profile/00861387900854837549</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://1.bp.blogspot.com/_p-E9D6bFkUY/SaVuWj-vwYI/AAAAAAAAAAo/bZ0v1BRWtJE/S220/IMG00060.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103619847444885405.post-598338477588374183</id><published>2009-10-01T13:49:00.000-07:00</published><updated>2009-10-01T13:53:38.958-07:00</updated><title type='text'>Adding Leading Zeros in T-SQL</title><content type='html'>Today I ran into a situation where I had a character data type column that contained product ID numbers and these numbers were missing leading numbers. The column was a CHAR(11) as all product IDs should begin with leading zeros and be 11 characters long. To add leading zeros to a NVACHAR, VARCHAR, OR CHAR type column, use the RIGHT function.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3333ff;"&gt;SELECT&lt;/span&gt; &lt;span style="color:#666666;"&gt;RIGHT&lt;/span&gt;(&lt;span style="color:#cc0000;"&gt;'&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;00000000000' &lt;/span&gt;+ &lt;span style="color:#cc33cc;"&gt;LTRIM&lt;/span&gt;(&lt;span style="color:#cc33cc;"&gt;RTRIM&lt;/span&gt;(PRODUCT_ID)),11) &lt;span style="color:#3333ff;"&gt;AS&lt;/span&gt; PRODUCT_ID&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Or;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3333ff;"&gt;SELECT &lt;/span&gt;&lt;span style="color:#666666;"&gt;RIGHT&lt;/span&gt;(&lt;span style="color:#cc33cc;"&gt;REPLICATE&lt;/span&gt;(&lt;span style="color:#ff0000;"&gt;'0',&lt;/span&gt; 11) + &lt;span style="color:#cc33cc;"&gt;LTRIM&lt;/span&gt;(&lt;span style="color:#cc33cc;"&gt;RTRIM&lt;/span&gt;(PRODUCT_ID)),11) &lt;span style="color:#3333ff;"&gt;&lt;span style="color:#3366ff;"&gt;AS&lt;/span&gt; &lt;/span&gt;PRODUCT_ID &lt;/span&gt;&lt;/em&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4103619847444885405-598338477588374183?l=claysql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claysql.blogspot.com/feeds/598338477588374183/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claysql.blogspot.com/2009/10/adding-leading-zeros-in-t-sql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/598338477588374183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/598338477588374183'/><link rel='alternate' type='text/html' href='http://claysql.blogspot.com/2009/10/adding-leading-zeros-in-t-sql.html' title='Adding Leading Zeros in T-SQL'/><author><name>Clay McDonald</name><uri>http://www.blogger.com/profile/00861387900854837549</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://1.bp.blogspot.com/_p-E9D6bFkUY/SaVuWj-vwYI/AAAAAAAAAAo/bZ0v1BRWtJE/S220/IMG00060.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103619847444885405.post-4895391331162141759</id><published>2009-09-14T06:57:00.000-07:00</published><updated>2009-10-14T10:17:29.317-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Summit 2009'/><category scheme='http://www.blogger.com/atom/ns#' term='Discount Code'/><category scheme='http://www.blogger.com/atom/ns#' term='PASS 2009'/><title type='text'>PASS SQL Summit 2009 Discount Code</title><content type='html'>With time running out for taking advantage of the pre-registration discounts to PASS 2009, here is a discount code for $100 off the registration fee. Get $100 off SQL Summit with code 24HR3D. See you at PASS 2009!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4103619847444885405-4895391331162141759?l=claysql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claysql.blogspot.com/feeds/4895391331162141759/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claysql.blogspot.com/2009/09/pass-sql-summit-2009-discount-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/4895391331162141759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/4895391331162141759'/><link rel='alternate' type='text/html' href='http://claysql.blogspot.com/2009/09/pass-sql-summit-2009-discount-code.html' title='PASS SQL Summit 2009 Discount Code'/><author><name>Clay McDonald</name><uri>http://www.blogger.com/profile/00861387900854837549</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://1.bp.blogspot.com/_p-E9D6bFkUY/SaVuWj-vwYI/AAAAAAAAAAo/bZ0v1BRWtJE/S220/IMG00060.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103619847444885405.post-3314337449127407111</id><published>2009-09-11T06:53:00.000-07:00</published><updated>2009-09-11T07:39:37.527-07:00</updated><title type='text'>Microsoft Launches Non-Profit Open Source Foundation</title><content type='html'>&lt;a href="http://1.bp.blogspot.com/_p-E9D6bFkUY/SqpXDVv7ZCI/AAAAAAAAACw/9ZiMd-NBAXQ/s1600-h/image_2.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5380208419736871970" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 294px; CURSOR: hand; HEIGHT: 72px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_p-E9D6bFkUY/SqpXDVv7ZCI/AAAAAAAAACw/9ZiMd-NBAXQ/s400/image_2.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;I’m not sure what to think of this. I have always been a fan of the open source movement. I know, then why am I a Microsoft DBA? I can only say, at the time, my employers required me to support Microsoft products. And after working with SQL Server for many years, I became comfortable with it.&lt;br /&gt;&lt;br /&gt;Anyway, Microsoft launched a new Non-Profit Open Source Foundation yesterday named, The CodePlex Foundation. And already, there are a lot of discussions about it. I think that Microsoft is trying to continue to build its community by having developers create open source software that will assist the community as a whole.&lt;br /&gt;&lt;br /&gt;Also, I have no doubt that Microsoft has a business motivation in this as well, because after all, Microsoft is a profit driven company. It could be that Microsoft would like to see if there are ways for them sell their products to entities that run open source, or it could be something more. Either way, I don’t believe open source developers will embrace it as evident in this &lt;a href="http://developers.slashdot.org/story/09/09/10/1712247/Microsoft-Launches-Its-Own-Open-Source-Foundation?art_pos=1"&gt;Slashdot post&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The CodePlex Foundation : &lt;a href="http://codeplex.org/"&gt;http://codeplex.org/&lt;/a&gt;&lt;/div&gt;&lt;br /&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/4103619847444885405-3314337449127407111?l=claysql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claysql.blogspot.com/feeds/3314337449127407111/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claysql.blogspot.com/2009/09/microsoft-launches-non-profit-open.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/3314337449127407111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/3314337449127407111'/><link rel='alternate' type='text/html' href='http://claysql.blogspot.com/2009/09/microsoft-launches-non-profit-open.html' title='Microsoft Launches Non-Profit Open Source Foundation'/><author><name>Clay McDonald</name><uri>http://www.blogger.com/profile/00861387900854837549</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://1.bp.blogspot.com/_p-E9D6bFkUY/SaVuWj-vwYI/AAAAAAAAAAo/bZ0v1BRWtJE/S220/IMG00060.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_p-E9D6bFkUY/SqpXDVv7ZCI/AAAAAAAAACw/9ZiMd-NBAXQ/s72-c/image_2.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103619847444885405.post-919561957175001940</id><published>2009-09-10T05:15:00.000-07:00</published><updated>2009-09-10T05:20:41.479-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Background'/><title type='text'>New SQL Server Background</title><content type='html'>&lt;a href="http://1.bp.blogspot.com/_p-E9D6bFkUY/Sqju7IcS5zI/AAAAAAAAACo/A8GvC7EtU8M/s1600-h/sql2k8BG.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5379812454539913010" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 250px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_p-E9D6bFkUY/Sqju7IcS5zI/AAAAAAAAACo/A8GvC7EtU8M/s400/sql2k8BG.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;I just picked up on Twitter that &lt;a href="http://blogs.msdn.com/buckwoody/" target="_blank"&gt;Buck Woody&lt;/a&gt; (MSFT) has published a &lt;a href="http://blogs.msdn.com/buckwoody/archive/2009/09/07/sql-server-desktop-screen-background.aspx" target="_blank"&gt;blog post&lt;/a&gt; about SQL Server Desktop Screen Background. Use the link below to get it.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blogs.msdn.com/buckwoody/archive/2009/09/07/sql-server-desktop-screen-background.aspx"&gt;http://blogs.msdn.com/buckwoody/archive/2009/09/07/sql-server-desktop-screen-background.aspx&lt;/a&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&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/4103619847444885405-919561957175001940?l=claysql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claysql.blogspot.com/feeds/919561957175001940/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claysql.blogspot.com/2009/09/new-sql-server-background.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/919561957175001940'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/919561957175001940'/><link rel='alternate' type='text/html' href='http://claysql.blogspot.com/2009/09/new-sql-server-background.html' title='New SQL Server Background'/><author><name>Clay McDonald</name><uri>http://www.blogger.com/profile/00861387900854837549</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://1.bp.blogspot.com/_p-E9D6bFkUY/SaVuWj-vwYI/AAAAAAAAAAo/bZ0v1BRWtJE/S220/IMG00060.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_p-E9D6bFkUY/Sqju7IcS5zI/AAAAAAAAACo/A8GvC7EtU8M/s72-c/sql2k8BG.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103619847444885405.post-5596186984326724506</id><published>2009-07-31T10:57:00.000-07:00</published><updated>2009-07-31T11:18:08.930-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Snapshots'/><category scheme='http://www.blogger.com/atom/ns#' term='Snapshot Sparse Files'/><category scheme='http://www.blogger.com/atom/ns#' term='Sparse File Size'/><category scheme='http://www.blogger.com/atom/ns#' term='Error 665'/><category scheme='http://www.blogger.com/atom/ns#' term='Error 1450'/><category scheme='http://www.blogger.com/atom/ns#' term='Snapshot Disaster Recovery'/><title type='text'>SQL Server Snapshot Sparse File Size</title><content type='html'>When you execute the CREATE AS SNAPSHOT sql statement, the snapshot creates a NTFS sparse file. In a sparse file only “nonzero” information is stored on the disk. The maximum size of a database snapshot is the size of the source database at snapshot creation. In Windows Explorer, the snapshot files are shown with a size matching that of the source database. However, when you go into the file properties you will see that the size on disk is &lt;span style="font-size:130%;"&gt;0&lt;/span&gt;KB or a multiple of 64KB (representing 1-8 data pages) if some data has been transferred.&lt;br /&gt;&lt;br /&gt;At the beginning, there is no source/user data in the snapshot file. It’s only after changes are made in the source database that data pages get written to the snapshot file. When a data page in the source database is changed, the original data page is first copied to the snapshot file before updating in the source database (copy-on-write). The first time any page is written to the sparse file the entire 64K extent is allocated. All other pages in the extent are written as zero's.&lt;br /&gt;&lt;br /&gt;When a sparse file is populated, Windows limits the amount of data that may reside in the file. Once the amount of data stored in the sparse file exceeds the limit further data storage in the file may be prevented.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#339999;"&gt;• Windows 2003 - 64GB (Error 1450 returned)&lt;br /&gt;• Windows 2008 and Vista - 16GB (Error 665 returned)&lt;/span&gt; &lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Windows 2003 Error:&lt;/strong&gt;&lt;span style="color:#ff0000;"&gt; &lt;/span&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;&lt;span style="color:#ff0000;"&gt;The operating system returned error 1450(Insufficient system resources exist to complete the requested service.) to SQL Server during a write at offset 0x000031abb4e000 in file with handle 0x00000F74. This is usually a temporary condition and the SQL Server will keep retrying the operation. If the condition persists then immediate action must be taken to correct it.&lt;/span&gt; &lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Windows 2008 Error:&lt;/strong&gt; &lt;em&gt;&lt;span style="color:#ff0000;"&gt;The operating system returned error 665(The requested operation could not be completed due to a file system limitation) to SQL Server during a write at offset 0x000005bd3dc000 in file 'Test.mdf:MSSQL_DBCC8'&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Let’s take a look at what takes place when the snapshots are created.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;A sparse file is created. This file will have the same file size as the database. Remember, the only data that may be contained in the snapshot file at this point are pointers to the source database data files. Only after something changes in the source database will copy-on-write insert data into the snapshot file.&lt;br /&gt;&lt;li&gt;The database is checkpointed (all dirty pages in the buffer cache are written to disk).&lt;br /&gt;&lt;li&gt;If uncommitted transactions are in progress in the database, the snapshot will reflect the state of the database before these transactions started in other words, in the context of the snapshot, these transactions will be rolled back – but transactions in the database itself are not.&lt;br /&gt;&lt;li&gt;The snapshot is brought online and is ready for use.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;strong&gt;Quick Note:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;From a Disaster Recovery standpoint, SQL Server snapshots are not very useful as they require an online database to function. In situations where there is a hardware failure, the database is no longer online and the snapshot becomes useless. Also, snapshots cannot be restored when users are accessing the database. So if there is a roll back in progress or some other process that does not allow the database’s state to be changed, snapshot restores can not be applied. However, in situations where an object was accidently deleted or altered, and needs to be restored, snapshots are ideal.&lt;br /&gt;&lt;br /&gt;For a more detailed look inside how Copy-On-Write works, see: &lt;a href="http://blogs.msdn.com/psssql/archive/2009/01/20/how-it-works-sql-server-sparse-files-dbcc-and-snapshot-databases-revisited.aspx"&gt;&lt;em&gt;&lt;span style="color:#000099;"&gt;http://blogs.msdn.com/psssql/archive/2009/01/20/how-it-works-sql-server-sparse-files-dbcc-and-snapshot-databases-revisited.aspx&lt;/span&gt;&lt;/em&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4103619847444885405-5596186984326724506?l=claysql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claysql.blogspot.com/feeds/5596186984326724506/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claysql.blogspot.com/2009/07/sql-server-snapshot-sparse-file-size.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/5596186984326724506'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/5596186984326724506'/><link rel='alternate' type='text/html' href='http://claysql.blogspot.com/2009/07/sql-server-snapshot-sparse-file-size.html' title='SQL Server Snapshot Sparse File Size'/><author><name>Clay McDonald</name><uri>http://www.blogger.com/profile/00861387900854837549</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://1.bp.blogspot.com/_p-E9D6bFkUY/SaVuWj-vwYI/AAAAAAAAAAo/bZ0v1BRWtJE/S220/IMG00060.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103619847444885405.post-502862306118378229</id><published>2009-07-01T14:40:00.000-07:00</published><updated>2009-07-01T15:17:13.940-07:00</updated><title type='text'>Can’t Delete Jobs (Microsoft SQL Server, Error: 547)</title><content type='html'>I was creating a new job to handle weekly database maintenance and when I attempted to delete the old job, I received the following error;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;TITLE: Microsoft SQL Server Management Studio&lt;br /&gt;------------------------------&lt;br /&gt;Drop failed for Job 'Weekly_Maintenance'. (Microsoft.SqlServer.Smo)&lt;br /&gt;&lt;br /&gt;For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&amp;amp;ProdVer=9.00.1399.00&amp;amp;EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&amp;amp;EvtID=Drop+Job&amp;amp;LinkId=20476 &lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;------------------------------&lt;br /&gt;ADDITIONAL INFORMATION:&lt;br /&gt;An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)&lt;br /&gt;------------------------------&lt;br /&gt;The DELETE statement conflicted with the REFERENCE constraint "FK_subplan_job_id". The conflict occurred in database "msdb", table "dbo.sysmaintplan_subplans", column 'job_id'.&lt;br /&gt;&lt;br /&gt;The statement has been terminated. (Microsoft SQL Server, Error: 547)&lt;br /&gt;------------------------------&lt;/span&gt;&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;If you try deleting the job from the sysmaintplan_subplans table, you also get the following error:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;Msg 547, Level 16, State 0, Line 41&lt;br /&gt;&lt;br /&gt;The DELETE statement conflicted with the REFERENCE constraint "FK_sysmaintplan_log_subplan_id". The conflict occurred in database "msdb", table "dbo.sysmaintplan_log", column 'subplan_id'.&lt;/em&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;I wanted to create a stored procedure that I could just pass a job name to and it would check each of the tables and delete all references for me. Here is what I came up with.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3366ff;"&gt;CREATE PROC&lt;/span&gt; dbo.DropJob&lt;br /&gt;@JobName &lt;span style="color:#3366ff;"&gt;AS VARCHAR&lt;/span&gt;(200) = &lt;span style="color:#999999;"&gt;NULL &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;AS&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3366ff;"&gt;DECLARE&lt;/span&gt; @msg &lt;span style="color:#3366ff;"&gt;AS VARCHAR&lt;/span&gt;(500);&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;IF&lt;/span&gt; @JobName &lt;span style="color:#999999;"&gt;IS NULL&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;BEGIN &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;SET&lt;/span&gt; @msg = N&lt;span style="color:#ff0000;"&gt;'A&lt;/span&gt;&lt;span style="color:#ff0000;"&gt; job name must be supplied for parameter @JobName.'&lt;/span&gt;;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;RAISERROR&lt;/span&gt;(@msg,16,1);&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;RETURN&lt;/span&gt;;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;END&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;IF&lt;/span&gt; &lt;span style="color:#999999;"&gt;EXISTS&lt;/span&gt; (&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;SELECT&lt;/span&gt; subplan_id &lt;span style="color:#3366ff;"&gt;FROM&lt;/span&gt; msdb.dbo.sysmaintplan_log &lt;span style="color:#3366ff;"&gt;WHERE&lt;/span&gt; subplan_id &lt;span style="color:#999999;"&gt;IN&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;( &lt;span style="color:#3366ff;"&gt;SELECT&lt;/span&gt; subplan_id &lt;span style="color:#3366ff;"&gt;FROM&lt;/span&gt; msdb.dbo.sysmaintplan_subplans &lt;span style="color:#3366ff;"&gt;WHERE&lt;/span&gt; job_id &lt;span style="color:#999999;"&gt;IN &lt;/span&gt;&lt;br /&gt;(&lt;span style="color:#3366ff;"&gt;SELECT&lt;/span&gt; job_id &lt;span style="color:#3366ff;"&gt;FROM&lt;/span&gt; msdb.dbo.sysjobs_view &lt;span style="color:#3366ff;"&gt;WHERE&lt;/span&gt;&lt;span style="color:#3366ff;"&gt; name&lt;/span&gt; = @JobName)))&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;BEGIN&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#3366ff;"&gt;DELETE FROM&lt;/span&gt; msdb.dbo.sysmaintplan_log &lt;span style="color:#3366ff;"&gt;WHERE&lt;/span&gt; subplan_id &lt;span style="color:#999999;"&gt;IN&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;( &lt;span style="color:#3366ff;"&gt;SELECT &lt;/span&gt;subplan_id &lt;span style="color:#3366ff;"&gt;FROM&lt;/span&gt; msdb.dbo.sysmaintplan_subplans &lt;span style="color:#3366ff;"&gt;WHERE &lt;/span&gt;job_id &lt;span style="color:#999999;"&gt;IN &lt;/span&gt;&lt;br /&gt;(&lt;span style="color:#3366ff;"&gt;SELECT &lt;/span&gt;job_id &lt;span style="color:#3366ff;"&gt;FROM &lt;/span&gt;msdb.dbo.sysjobs_view &lt;span style="color:#3366ff;"&gt;WHERE &lt;/span&gt;name = @JobName));&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;DELETE FROM&lt;/span&gt; msdb.dbo.sysmaintplan_subplans &lt;span style="color:#3366ff;"&gt;WHERE&lt;/span&gt; job_id &lt;span style="color:#999999;"&gt;IN&lt;br /&gt;&lt;/span&gt;(&lt;span style="color:#3366ff;"&gt;SELECT&lt;/span&gt; job_id &lt;span style="color:#3366ff;"&gt;FROM&lt;/span&gt; msdb.dbo.sysjobs_view &lt;span style="color:#3366ff;"&gt;WHERE&lt;/span&gt; name = @JobName);&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;EXEC&lt;/span&gt; msdb.dbo.&lt;span style="color:#660000;"&gt;sp_delete_job&lt;/span&gt; @job_name=@JobName, @delete_unused_schedule=1;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;END&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#3366ff;"&gt;ELSE IF&lt;/span&gt; &lt;span style="color:#999999;"&gt;EXISTS &lt;/span&gt;(&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;SELECT&lt;/span&gt; subplan_id &lt;span style="color:#3366ff;"&gt;FROM &lt;/span&gt;msdb.dbo.sysmaintplan_subplans &lt;span style="color:#3366ff;"&gt;WHERE&lt;/span&gt; job_id &lt;span style="color:#999999;"&gt;IN &lt;/span&gt;&lt;br /&gt;(&lt;span style="color:#3366ff;"&gt;SELECT &lt;/span&gt;job_id &lt;span style="color:#3366ff;"&gt;FROM&lt;/span&gt; msdb.dbo.sysjobs_view &lt;span style="color:#3366ff;"&gt;WHERE&lt;/span&gt; name = @JobName))&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;BEGIN&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3366ff;"&gt;DELETE FROM&lt;/span&gt; msdb.dbo.sysmaintplan_subplans &lt;span style="color:#3366ff;"&gt;WHERE&lt;/span&gt; job_id &lt;span style="color:#999999;"&gt;IN &lt;/span&gt;&lt;br /&gt;(&lt;span style="color:#3366ff;"&gt;SELECT&lt;/span&gt; job_id &lt;span style="color:#3366ff;"&gt;FROM&lt;/span&gt; msdb.dbo.sysjobs_view &lt;span style="color:#3366ff;"&gt;WHERE &lt;/span&gt;name = @JobName);&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3366ff;"&gt;EXEC&lt;/span&gt; msdb.dbo.&lt;span style="color:#660000;"&gt;sp_delete_job&lt;/span&gt; @job_name=@JobName, @delete_unused_schedule=1;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;END&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;ELSE&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;BEGIN &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;EXEC &lt;/span&gt;msdb.dbo.&lt;span style="color:#660000;"&gt;sp_delete_job&lt;/span&gt; @job_name=@JobName, @delete_unused_schedule=1; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3366ff;"&gt;END &lt;/span&gt;&lt;br /&gt;GO&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Now you can call the SP with the following;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3366ff;"&gt;USE&lt;/span&gt; [msdb];&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;EXEC&lt;/span&gt; dbo.DropJob @JobName = N&lt;span style="color:#ff0000;"&gt;'S&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;hrink_AWP_Databases.Subplan_1'&lt;/span&gt;; &lt;/span&gt;&lt;/em&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4103619847444885405-502862306118378229?l=claysql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claysql.blogspot.com/feeds/502862306118378229/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claysql.blogspot.com/2009/07/cant-delete-job-microsoft-sql-server.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/502862306118378229'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/502862306118378229'/><link rel='alternate' type='text/html' href='http://claysql.blogspot.com/2009/07/cant-delete-job-microsoft-sql-server.html' title='Can’t Delete Jobs (Microsoft SQL Server, Error: 547)'/><author><name>Clay McDonald</name><uri>http://www.blogger.com/profile/00861387900854837549</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://1.bp.blogspot.com/_p-E9D6bFkUY/SaVuWj-vwYI/AAAAAAAAAAo/bZ0v1BRWtJE/S220/IMG00060.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103619847444885405.post-3802906447984400715</id><published>2009-06-24T12:57:00.000-07:00</published><updated>2009-06-24T13:38:29.774-07:00</updated><title type='text'>Convert Legacy 6 Character and 7 Character CC YY MM DD (ISO) Dates</title><content type='html'>The dates are stored as Century, Year, Month, and Day, where Century is 0 for 19 and 1 for 20, years are stored as two digits, and months and days always have leading zeros. In this example, somewhere along the way, the leading zeros for the Century were dropped.&lt;br /&gt;&lt;br /&gt;Sample Data:&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5350987290443392690" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: hand; HEIGHT: 150px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_p-E9D6bFkUY/SkKGlwSCJrI/AAAAAAAAAB4/JBEARnyaXI0/s400/ISO_Dates.JPG" border="0" /&gt;&lt;br /&gt;Let’s start solving this by creating our test data.&lt;br /&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;&lt;span style="color:#3333ff;"&gt;&lt;span style="font-size:100%;color:#000000;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;&lt;span style="color:#3333ff;"&gt;CREATE TABLE&lt;/span&gt; [dbo].[TestDates](&lt;br /&gt;[Row_ID] [numeric](18, 0) &lt;span style="color:#3333ff;"&gt;IDENTITY&lt;/span&gt;(1,1) NOT NULL,&lt;br /&gt;[Legacy_Date] [varchar](8),&lt;br /&gt;[SQL_Date] [datetime])&lt;br /&gt;GO&lt;/em&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;&lt;span style="color:#3333ff;"&gt;INSERT INTO&lt;/span&gt; [HI_Plaintiff].[dbo].[TestDates] ([Legacy_Date])&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;VALUES&lt;/span&gt;(&lt;span style="color:#ff0000;"&gt;'1000118'&lt;/span&gt;)&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;INSERT INTO&lt;/span&gt; [HI_Plaintiff].[dbo].[TestDates] ([Legacy_Date])&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;VALUES&lt;/span&gt;(&lt;span style="color:#ff0000;"&gt;'1&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;000229'&lt;/span&gt;)&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;INSERT INTO&lt;/span&gt; [HI_Plaintiff].[dbo].[TestDates] ([Legacy_Date])&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;VALUES&lt;/span&gt;(&lt;span style="color:#ff0000;"&gt;'1&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;000509'&lt;/span&gt;)&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;INSERT INTO&lt;/span&gt; [HI_Plaintiff].[dbo].[TestDates] ([Legacy_Date])&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;VALUES&lt;/span&gt;(&lt;span style="color:#ff0000;"&gt;'9&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;60426'&lt;/span&gt;)&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;INSERT INTO&lt;/span&gt; [HI_Plaintiff].[dbo].[TestDates] ([Legacy_Date])&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;VALUES&lt;/span&gt;(&lt;span style="color:#ff0000;"&gt;'981003'&lt;/span&gt;)&lt;br /&gt;GO&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;INSERT INTO&lt;/span&gt; [HI_Plaintiff].[dbo].[TestDates] ([Legacy_Date])&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;VALUES&lt;/span&gt;(&lt;span style="color:#ff0000;"&gt;'95&lt;/span&gt;&lt;span style="color:#ff0000;"&gt;0899'&lt;/span&gt;)&lt;br /&gt;GO&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;Here is a simple query that will only update valid ISO dates to SQL Server’s datetime data type.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3333ff;"&gt;UPDATE&lt;/span&gt; dbo.TestDates&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;SET&lt;/span&gt; SQL_Date = &lt;span style="color:#cc33cc;"&gt;CONVERT&lt;/span&gt;(&lt;span style="color:#3366ff;"&gt;VARCHAR&lt;/span&gt;(10), &lt;span style="color:#cc33cc;"&gt;CONVERT&lt;/span&gt;(&lt;span style="color:#3333ff;"&gt;DATETIME&lt;/span&gt;,&lt;span style="color:#cc33cc;"&gt; CONVERT&lt;/span&gt;(&lt;span style="color:#3333ff;"&gt;VARCHAR&lt;/span&gt;(8), Legacy_Date + 19000000)), 101)&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;WHERE&lt;/span&gt; &lt;span style="color:#cc33cc;"&gt;ISDATE&lt;/span&gt;(&lt;span style="color:#cc33cc;"&gt;CONVERT&lt;/span&gt;(&lt;span style="color:#3333ff;"&gt;VARCHAR&lt;/span&gt;(8), Legacy_Date + 19000000)) = 1&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;em&gt;GO&lt;/em&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4103619847444885405-3802906447984400715?l=claysql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claysql.blogspot.com/feeds/3802906447984400715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claysql.blogspot.com/2009/06/convert-legacy-6-character-and-7.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/3802906447984400715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/3802906447984400715'/><link rel='alternate' type='text/html' href='http://claysql.blogspot.com/2009/06/convert-legacy-6-character-and-7.html' title='Convert Legacy 6 Character and 7 Character CC YY MM DD (ISO) Dates'/><author><name>Clay McDonald</name><uri>http://www.blogger.com/profile/00861387900854837549</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://1.bp.blogspot.com/_p-E9D6bFkUY/SaVuWj-vwYI/AAAAAAAAAAo/bZ0v1BRWtJE/S220/IMG00060.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_p-E9D6bFkUY/SkKGlwSCJrI/AAAAAAAAAB4/JBEARnyaXI0/s72-c/ISO_Dates.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103619847444885405.post-2498622465415852643</id><published>2009-06-10T05:11:00.000-07:00</published><updated>2009-06-10T05:37:09.009-07:00</updated><title type='text'>Copy Several Tables to a Different Database Using Dynamic SQL</title><content type='html'>&lt;span &gt;Here is a quick example of how to used dynamic SQL in a cursor to copy several tables from one database to another. I was given a list of 150 tables that one of my customers needed to be copied. I didn’t want to script all of them so I created this cursor. All you need to do is create a list of the tables to be copied.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="http://2.bp.blogspot.com/_p-E9D6bFkUY/Si-mggLOdzI/AAAAAAAAABo/V9N37gf9n8Y/s1600-h/TransTableList.JPG"&gt;&lt;/a&gt;&lt;span &gt;In this example, I’m using Excel. In my list the SOURCE is the name of the table that we are copying from and the TARGET is where it’s being copied to.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;img style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 811px; CURSOR: hand; HEIGHT: 313px; TEXT-ALIGN: center" alt="" src="http://scmbusinesssolutions.com/images/TransTableList.JPG" border="0" /&gt; &lt;p&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:arial;"&gt;In the SOURCE database, create the following table.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-family:times new roman;font-size:85%;"&gt;&lt;span style="color:#3333ff;"&gt;CREATE TABLE&lt;/span&gt; [dbo].[TRANSFER_TABLE_LIST](&lt;br /&gt;[SOURCE_TABLE] [varchar](100),&lt;br /&gt;[SOURCE_SCHEMA] [varchar](100),&lt;br /&gt;[SOURCE_DATABASE] [varchar](100),&lt;br /&gt;[TARGET_TABLE] [varchar](100),&lt;br /&gt;[TARGET_SCHEMA] [varchar](100),&lt;br /&gt;[TARGET_DATABASE] [varchar](100)&lt;br /&gt;)&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;GO&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:arial;"&gt;Now, import your table list into the TRANSFER_TABLE_LIST table and create the following cursor.&lt;br /&gt;&lt;span style="font-family:times new roman;font-size:85%;"&gt;&lt;em&gt;&lt;span style="color:#3333ff;"&gt;DECLARE&lt;/span&gt; @SQL &lt;span style="color:#3333ff;"&gt;AS VARCHAR&lt;/span&gt; (2000), @SOURCE_TABLE &lt;span style="color:#3333ff;"&gt;AS VARCHAR&lt;/span&gt; (100),&lt;br /&gt;@SOURCE_SCHEMA &lt;span style="color:#3333ff;"&gt;AS VARCHAR&lt;/span&gt; (100), @SOURCE_DATABASE &lt;span style="color:#3333ff;"&gt;AS VARCHAR&lt;/span&gt; (100),&lt;br /&gt;@TARGET_TABLE &lt;span style="color:#3333ff;"&gt;AS VARCHAR&lt;/span&gt; (100), @TARGET_SCHEMA &lt;span style="color:#3333ff;"&gt;AS VARCHAR&lt;/span&gt; (100),&lt;br /&gt;@TARGET_DATABASE &lt;span style="color:#3333ff;"&gt;AS VARCHAR&lt;/span&gt; (100)&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;DECLARE&lt;/span&gt; c1 &lt;span style="color:#3333ff;"&gt;CURSOR&lt;/span&gt; READ_ONLY&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;FOR&lt;br /&gt;SELECT&lt;/span&gt; [SOURCE_TABLE]&lt;br /&gt;,[SOURCE_SCHEMA]&lt;br /&gt;,[SOURCE_DATABASE]&lt;br /&gt;,[TARGET_TABLE]&lt;br /&gt;,[TARGET_SCHEMA]&lt;br /&gt;,[TARGET_DATABASE]&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;FROM&lt;/span&gt; [dbo].[TRANSFER_TABLE_LIST]&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;OPEN&lt;/span&gt; c1&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;FETCH&lt;/span&gt; NEXT &lt;span style="color:#3333ff;"&gt;FROM &lt;/span&gt;c1&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;INTO&lt;/span&gt; @SOURCE_TABLE, @SOURCE_SCHEMA, @SOURCE_DATABASE, @TARGET_TABLE, @TARGET_SCHEMA, @TARGET_DATABASE&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;WHILE&lt;/span&gt; &lt;span style="color:#cc33cc;"&gt;@@FETCH_STATUS&lt;/span&gt; = 0&lt;br /&gt;BEGIN&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;SET&lt;/span&gt; @SQL = &lt;span style="color:#ff0000;"&gt;'SELECT * INTO ['&lt;/span&gt; + @TARGET_DATABASE + &lt;span style="color:#ff0000;"&gt;'].['&lt;/span&gt; + @TARGET_SCHEMA + &lt;span style="color:#ff0000;"&gt;'].['&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;SET&lt;/span&gt; @SQL = @SQL + @TARGET_TABLE + &lt;span style="color:#ff0000;"&gt;'] FROM ['&lt;/span&gt; + @SOURCE_DATABASE + &lt;span style="color:#ff0000;"&gt;'].['&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;SET &lt;/span&gt;@SQL = @SQL + @SOURCE_SCHEMA + &lt;span style="color:#ff0000;"&gt;'].['&lt;/span&gt; + @SOURCE_TABLE + &lt;span style="color:#ff0000;"&gt;'];'&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;EXEC&lt;/span&gt; (@SQL)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;FETCH&lt;/span&gt; NEXT &lt;span style="color:#3333ff;"&gt;FROM &lt;/span&gt;c1&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;INTO&lt;/span&gt; @SOURCE_TABLE, @SOURCE_SCHEMA, @SOURCE_DATABASE, @TARGET_TABLE, @TARGET_SCHEMA, @TARGET_DATABASE&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;END&lt;br /&gt;CLOSE&lt;/span&gt; c1&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;DEALLOCATE&lt;/span&gt; c1&lt;/em&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;If you receive the &lt;span &gt;following&lt;/span&gt; error:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;font-size:85%;"&gt;&lt;em&gt;&lt;span style="color:#ff0000;"&gt;Msg 203, Level 16, State 2, Line 23&lt;br /&gt;The name 'SELECT * INTO [TransCorpReporting].[dbo].[Products_cust_trans] FROM [TransCorp].[dbo].[Products_cust_trans];' is not a valid identifier.&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;This means that you forgot to add&lt;strong&gt; ( )&lt;/strong&gt; around the @SQL variable. &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/4103619847444885405-2498622465415852643?l=claysql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claysql.blogspot.com/feeds/2498622465415852643/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claysql.blogspot.com/2009/06/copy-several-tables-to-different.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/2498622465415852643'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/2498622465415852643'/><link rel='alternate' type='text/html' href='http://claysql.blogspot.com/2009/06/copy-several-tables-to-different.html' title='Copy Several Tables to a Different Database Using Dynamic SQL'/><author><name>Clay McDonald</name><uri>http://www.blogger.com/profile/00861387900854837549</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://1.bp.blogspot.com/_p-E9D6bFkUY/SaVuWj-vwYI/AAAAAAAAAAo/bZ0v1BRWtJE/S220/IMG00060.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103619847444885405.post-1492144791027600935</id><published>2009-03-16T13:07:00.000-07:00</published><updated>2009-03-17T12:12:46.728-07:00</updated><title type='text'>Visit Falafel King at PASS 2009</title><content type='html'>&lt;img id="BLOGGER_PHOTO_ID_5313883826517343650" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 240px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_p-E9D6bFkUY/Sb61L6FCfaI/AAAAAAAAABY/e31n8aIDP5Q/s320/n1077939483_230123_7581.jpg" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;If you’ve been to the PASS Community Summit before, you’ll know that PASS does a great job at providing meals during the Summit. However, if you should miss meal time, don’t worry, just walk down Pike Street to 1st Street. There you’ll find Falafel King.&lt;br /&gt;&lt;br /&gt;Falafel King in downtown Seattle is the best purveyor of Middle Eastern food I have ever had the privilege of patronizing. You can get an awesome meal for under $10.00. If you ever visit Seattle, you need to pay Falafel King a visit!&lt;br /&gt;&lt;br /&gt;PASS: &lt;a href="http://www.sqlpass.org/"&gt;http://www.sqlpass.org/&lt;/a&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/4103619847444885405-1492144791027600935?l=claysql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claysql.blogspot.com/feeds/1492144791027600935/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claysql.blogspot.com/2009/03/visit-falafel-king-at-pass-2009.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/1492144791027600935'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/1492144791027600935'/><link rel='alternate' type='text/html' href='http://claysql.blogspot.com/2009/03/visit-falafel-king-at-pass-2009.html' title='Visit Falafel King at PASS 2009'/><author><name>Clay McDonald</name><uri>http://www.blogger.com/profile/00861387900854837549</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://1.bp.blogspot.com/_p-E9D6bFkUY/SaVuWj-vwYI/AAAAAAAAAAo/bZ0v1BRWtJE/S220/IMG00060.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_p-E9D6bFkUY/Sb61L6FCfaI/AAAAAAAAABY/e31n8aIDP5Q/s72-c/n1077939483_230123_7581.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103619847444885405.post-9048270875149517265</id><published>2009-02-26T14:27:00.000-08:00</published><updated>2009-02-26T15:20:17.875-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Database Mail from Trigger'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server Database Mail'/><title type='text'>Send Database Mail from a Trigger</title><content type='html'>I was attempting to set up a trigger to send an email when a record was inserted into a table. I followed the instructions in Books Online, however, somewhere along the way, I ended up with the following error;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#ff0000;"&gt;[SqlException (0x80131904): EXECUTE permission denied on object 'sp_send_dbmail', database 'msdb', schema 'dbo'.]&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;As I attempted to solve for this error, I ended up using EXECUTE AS in the trigger. When attempting to use this method, I received the following error;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#ff0000;"&gt;[SqlException (0x80131904): Cannot execute as the server principal because the principal "SQLMail" does not exist, this type of principal cannot be impersonated, or you do not have permission.]&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;The I decieded to trun away from all the post that I was following on the internet and start from scratch in a test enviorment. Here’s what I did:&lt;br /&gt;&lt;br /&gt;As dbo, create the database Principal that will use Test database to send the email.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3333ff;"&gt;USE&lt;/span&gt; [master]&lt;br /&gt;GO&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;CREATE LOGIN&lt;/span&gt; [TestUser] &lt;span style="color:#3333ff;"&gt;WITH&lt;/span&gt; PASSWORD=N&lt;span style="color:#ff0000;"&gt;'password' &lt;/span&gt;&lt;br /&gt;GO&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Create the database Principal that will use msdb database to send the email.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3333ff;"&gt;USE&lt;/span&gt; [master]&lt;br /&gt;GO&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;CREATE LOGIN&lt;/span&gt; [MailUser] &lt;span style="color:#3333ff;"&gt;WITH&lt;/span&gt; PASSWORD=&lt;/span&gt;&lt;/em&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#ff0000;"&gt;N'password'&lt;br /&gt;&lt;/span&gt;GO&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;EXEC&lt;/span&gt; master..&lt;span style="color:#990000;"&gt;sp_addsrvrolemember&lt;/span&gt; @loginame = N'&lt;span style="color:#ff0000;"&gt;Mail_User'&lt;/span&gt;, @rolename = N'&lt;/span&gt;&lt;/em&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#ff0000;"&gt;sysadmin'&lt;br /&gt;&lt;/span&gt;GO&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Now start setting up the mail. To send Database Mail using stored procedures, you must be a member of the DatabaseMailUserRole database role in the msdb database.&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3333ff;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3333ff;"&gt;USE &lt;/span&gt;[msdb]&lt;br /&gt;GO&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;CREATE&lt;/span&gt; &lt;span style="color:#cc33cc;"&gt;USER &lt;/span&gt;[MailUser] &lt;span style="color:#3333ff;"&gt;FOR LOGIN&lt;/span&gt; [MailUser] &lt;span style="color:#3333ff;"&gt;WITH&lt;/span&gt; DEFAULT_SCHEMA=[dbo]&lt;br /&gt;GO&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;USE&lt;/span&gt; [msdb]&lt;br /&gt;GO&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;EXEC&lt;/span&gt; &lt;span style="color:#990000;"&gt;sp_addrolemember&lt;/span&gt; N&lt;span style="color:#ff0000;"&gt;'DatabaseMailUserRole'&lt;/span&gt;, N'&lt;/span&gt;&lt;/em&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#ff0000;"&gt;MailUser'&lt;br /&gt;&lt;/span&gt;GO&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Execute permissions for sp_send_dbmail default to all members of the DatabaseMailUser database role in the msdb database.&lt;br /&gt;&lt;br /&gt;To list all other members of the &lt;strong&gt;DatabaseMailUserRole&lt;/strong&gt; execute the following statement:&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3333ff;"&gt;EXEC &lt;/span&gt;msdb.sys.sp_helprolemember &lt;span style="color:#ff0000;"&gt;'DatabaseMailUserRole'&lt;/span&gt;;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Go to Surface Area configuration for features and expand Database engine option and select DatabaseMail option and checked Enable Database mail Stored procedure and click OK or Apply button.&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5307244619413309714" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 235px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_p-E9D6bFkUY/Sace3MQ7yRI/AAAAAAAAABI/G6nvTD-k7j4/s320/SSSAC.JPG" border="0" /&gt;&lt;br /&gt;Create a new Database Mail account.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3333ff;"&gt;EXECUTE&lt;/span&gt; msdb.dbo.sysmail_add_account_sp&lt;br /&gt;@account_name = &lt;span style="color:#ff0000;"&gt;'Test_Database_Mail'&lt;/span&gt;,&lt;br /&gt;@description = &lt;span style="color:#ff0000;"&gt;'Mail account for testing sending email.'&lt;/span&gt;,&lt;br /&gt;@email_address = &lt;span style="color:#ff0000;"&gt;'somebody@domain.com'&lt;/span&gt;,&lt;br /&gt;@replyto_address = &lt;span style="color:#ff0000;"&gt;'somebody@domain.com'&lt;/span&gt;,&lt;br /&gt;@display_name = &lt;span style="color:#ff0000;"&gt;'Clay McDonald'&lt;/span&gt;,&lt;br /&gt;@mailserver_name = &lt;span style="color:#ff0000;"&gt;'mail.domian.com'&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;color:#ff0000;"&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Create a Database Mail profile.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3333ff;"&gt;EXECUTE &lt;/span&gt;msdb.dbo.sysmail_add_profile_sp&lt;br /&gt;@profile_name = &lt;span style="color:#ff0000;"&gt;'Test_Email_Profile',&lt;/span&gt;&lt;br /&gt;@description = &lt;span style="color:#ff0000;"&gt;'Profile for testing sending email.'&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;color:#ff0000;"&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;Add the account to the profile.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3333ff;"&gt;EXECUTE&lt;/span&gt; msdb.dbo.sysmail_add_profileaccount_sp&lt;br /&gt;@profile_name = &lt;span style="color:#ff0000;"&gt;'Test_Email_Profile'&lt;/span&gt;,&lt;br /&gt;@account_name = &lt;span style="color:#ff0000;"&gt;'Test_Database_Mail'&lt;/span&gt;,&lt;br /&gt;@sequence_number = 1&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Grant access to the profile to all users in the msdb database.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3333ff;"&gt;EXECUTE&lt;/span&gt; msdb.dbo.sysmail_add_principalprofile_sp&lt;br /&gt;@profile_name = &lt;span style="color:#ff0000;"&gt;'Test_Email_Profile'&lt;/span&gt;,&lt;br /&gt;@principal_name = &lt;span style="color:#ff0000;"&gt;'public'&lt;/span&gt;,&lt;br /&gt;@is_default = 1&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Check to see if Service Broker is enabled.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3333ff;"&gt;SELECT&lt;/span&gt; is_broker_enabled &lt;span style="color:#3333ff;"&gt;FROM&lt;/span&gt; &lt;span style="color:#009900;"&gt;sys.databases&lt;/span&gt; &lt;span style="color:#3333ff;"&gt;WHERE&lt;/span&gt; name = &lt;span style="color:#ff0000;"&gt;'msdb'&lt;/span&gt;;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;is_broker_enabled will be 1 if Service Broker is enabled for the given database, otherwise it'll be 0.&lt;br /&gt;&lt;br /&gt;To enable Service Broker run the following;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3333ff;"&gt;ALTER DATABASE&lt;/span&gt; msdb&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;SET&lt;/span&gt; ENABLE_BROKER;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Now test that Database Mail is working.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3333ff;"&gt;EXEC&lt;/span&gt; msdb.dbo.sp_send_dbmail&lt;br /&gt;@profile_name = &lt;span style="color:#ff0000;"&gt;'Test_Email_Profile'&lt;/span&gt;,&lt;br /&gt;@recipients=&lt;span style="color:#ff0000;"&gt;'somebody@domain.com'&lt;/span&gt;,&lt;br /&gt;@body = &lt;span style="color:#ff0000;"&gt;'This is a test for Database Mail.'&lt;/span&gt;,&lt;br /&gt;@body_format = &lt;span style="color:#ff0000;"&gt;'TEXT'&lt;/span&gt;,&lt;br /&gt;@subject = &lt;/span&gt;&lt;/em&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#ff0000;"&gt;'Database Mail Test'&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#009900;"&gt;-- eMail sent!&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Now I create my test database.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3333ff;"&gt;USE&lt;/span&gt; [master]&lt;br /&gt;GO&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;CREATE DATABASE&lt;/span&gt; [Test] &lt;span style="color:#3333ff;"&gt;ON PRIMARY&lt;/span&gt;&lt;br /&gt;( &lt;span style="color:#3333ff;"&gt;NAME&lt;/span&gt; = N'&lt;span style="color:#ff0000;"&gt;Test'&lt;/span&gt;, &lt;span style="color:#3333ff;"&gt;FILENAME&lt;/span&gt; = N&lt;span style="color:#ff0000;"&gt;'D:\MSSQL\DATA\Test.mdf'&lt;/span&gt; , &lt;span style="color:#3333ff;"&gt;SIZE&lt;/span&gt; = 2048KB , &lt;span style="color:#3333ff;"&gt;MAXSIZE&lt;/span&gt; = UNLIMITED, &lt;span style="color:#3333ff;"&gt;FILEGROWTH&lt;/span&gt; = 1024KB )&lt;br /&gt;&lt;span style="color:#cc66cc;"&gt;LOG&lt;/span&gt; &lt;/span&gt;&lt;/em&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3333ff;"&gt;ON&lt;br /&gt;&lt;/span&gt;( &lt;span style="color:#3333ff;"&gt;NAME&lt;/span&gt; = N'&lt;span style="color:#ff0000;"&gt;Test_log'&lt;/span&gt;, &lt;span style="color:#3333ff;"&gt;FILENAME&lt;/span&gt; = N'&lt;span style="color:#ff0000;"&gt;D:\MSSQL\LOG\Test_log.ldf'&lt;/span&gt; , &lt;span style="color:#3333ff;"&gt;SIZE&lt;/span&gt; = 1024KB , &lt;span style="color:#3333ff;"&gt;MAXSIZE&lt;/span&gt; = 2048GB , &lt;span style="color:#3333ff;"&gt;FILEGROWTH&lt;/span&gt; = 10%)&lt;br /&gt;GO&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;EXEC&lt;/span&gt; dbo.&lt;span style="color:#990000;"&gt;sp_dbcmptlevel&lt;/span&gt; @dbname=N'&lt;span style="color:#ff0000;"&gt;Test',&lt;/span&gt; @new_cmptlevel=90&lt;br /&gt;GO&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Then create test table that will fire the trigger.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3333ff;"&gt;USE&lt;/span&gt; [Test]&lt;br /&gt;GO&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;CREATE TABLE&lt;/span&gt; [dbo].[NewMail](&lt;br /&gt;[ID] [int] &lt;span style="color:#3333ff;"&gt;IDENTITY&lt;/span&gt;(1,1) NOT NULL,&lt;br /&gt;[Some_Text] [varchar](&lt;span style="color:#cc33cc;"&gt;max&lt;/span&gt;) NULL&lt;br /&gt;)&lt;br /&gt;GO&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Create the trigger.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3333ff;"&gt;USE&lt;/span&gt; Test&lt;br /&gt;GO&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;CREATE TRIGGER&lt;/span&gt; TestMailTrigger&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;ON&lt;/span&gt; dbo.NewMail&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;span style="font-size:85%;color:#3333ff;"&gt;&lt;em&gt;AFTER INSERT&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3333ff;"&gt;AS&lt;br /&gt;BEGIN&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;EXEC&lt;/span&gt; msdb.dbo.sp_send_dbmail&lt;br /&gt;@profile_name = &lt;span style="color:#ff0000;"&gt;'Test_Email_Profile'&lt;/span&gt;,&lt;br /&gt;@recipients=&lt;span style="color:#ff0000;"&gt;'somebody@domain.com'&lt;/span&gt;,&lt;br /&gt;@body = &lt;span style="color:#ff0000;"&gt;'This is a test for Database Mail.'&lt;/span&gt;,&lt;br /&gt;@body_format = &lt;span style="color:#ff0000;"&gt;'TEXT'&lt;/span&gt;,&lt;br /&gt;@subject = &lt;/span&gt;&lt;/em&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#ff0000;"&gt;'Database Mail Test'&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#3333ff;"&gt;END &lt;/span&gt;&lt;br /&gt;GO&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Test the trigger.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3333ff;"&gt;USE&lt;/span&gt; Test&lt;br /&gt;GO&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;INSERT INTO&lt;/span&gt; dbo.NewMail (Some_Text)&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;VALUES&lt;/span&gt;(&lt;span style="color:#ff0000;"&gt;'Fire the trigger to send mail'&lt;/span&gt;)&lt;br /&gt;GO&lt;br /&gt;&lt;span style="color:#009900;"&gt;-- Mail sent!&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Now we test logging in as TestUser. First, add TestUser to the Test database.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3333ff;"&gt;USE&lt;/span&gt; [Test]&lt;br /&gt;GO&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;CREATE&lt;/span&gt; &lt;span style="color:#cc33cc;"&gt;USER&lt;/span&gt; [TestUser] &lt;span style="color:#3333ff;"&gt;FOR LOGIN&lt;/span&gt; [TestUser] &lt;span style="color:#3333ff;"&gt;WITH&lt;/span&gt; DEFAULT_SCHEMA=[dbo]&lt;br /&gt;GO&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;USE&lt;/span&gt; [Test]&lt;br /&gt;GO&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;EXEC&lt;/span&gt; &lt;span style="color:#990000;"&gt;sp_addrolemember&lt;/span&gt; N'&lt;span style="color:#ff0000;"&gt;db_datareader'&lt;/span&gt;, &lt;/span&gt;&lt;/em&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#ff0000;"&gt;&lt;span style="color:#000000;"&gt;N&lt;/span&gt;'TestUser'&lt;br /&gt;&lt;/span&gt;GO&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;USE&lt;/span&gt; [Test]&lt;br /&gt;GO&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;EXEC&lt;/span&gt; &lt;span style="color:#990000;"&gt;sp_addrolemember&lt;/span&gt; N'&lt;span style="color:#ff0000;"&gt;db_datawriter'&lt;/span&gt;, N'&lt;span style="color:#ff0000;"&gt;TestUser' &lt;/span&gt;&lt;br /&gt;GO &lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Now, disconnect and reconnect as Test_User.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3333ff;"&gt;USE&lt;/span&gt; Test&lt;br /&gt;GO&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;INSERT INTO&lt;/span&gt; dbo.NewMail (Some_Text)&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;VALUES&lt;/span&gt;(&lt;span style="color:#ff0000;"&gt;'Fire the trigger to send mail'&lt;/span&gt;)&lt;br /&gt;GO&lt;br /&gt;&lt;span style="color:#009900;"&gt;-- It works!&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;NOTE: Database Mail messages and their attachments are stored in the msdb database. Messages should be periodically deleted to prevent msdb from growing larger than expected and to comply with your organizations document retention program. Use the sysmail_delete_mailitems_sp stored procedure to permanently delete e-mail messages from the Database Mail tables. An optional argument allows you to delete only older e-mails by providing a date and time. E-mails older than that argument will be deleted. Another optional argument allows you to delete only e-mails of a certain type, specified as the sent_status argument. You must provide an argument either for @sent_before or @sent_status. To delete all messages, use @sent_before = getdate().&lt;br /&gt;&lt;br /&gt;If you have permission issues, you can start over by deleting Database Mail Accounts.&lt;br /&gt;In SQL Mgt Studio, under Management -&gt; Database Mail, you can select “Manage Database Mail accounts and profile”. Here you’ll find options for managing accounts and profiles.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5307245741890117554" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 216px; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_p-E9D6bFkUY/Sacf4h0Qn7I/AAAAAAAAABQ/bbhZQkHYbuU/s320/DatabaseMailConfigWizard.JPG" border="0" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4103619847444885405-9048270875149517265?l=claysql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claysql.blogspot.com/feeds/9048270875149517265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claysql.blogspot.com/2009/02/send-database-mail-from-trigger.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/9048270875149517265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/9048270875149517265'/><link rel='alternate' type='text/html' href='http://claysql.blogspot.com/2009/02/send-database-mail-from-trigger.html' title='Send Database Mail from a Trigger'/><author><name>Clay McDonald</name><uri>http://www.blogger.com/profile/00861387900854837549</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://1.bp.blogspot.com/_p-E9D6bFkUY/SaVuWj-vwYI/AAAAAAAAAAo/bZ0v1BRWtJE/S220/IMG00060.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_p-E9D6bFkUY/Sace3MQ7yRI/AAAAAAAAABI/G6nvTD-k7j4/s72-c/SSSAC.JPG' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103619847444885405.post-4209745619808880924</id><published>2009-02-25T07:20:00.000-08:00</published><updated>2009-02-25T08:12:51.179-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server 2005 Administration'/><title type='text'>Receiving Error: 18461 When Attempting to Move System Databases</title><content type='html'>I was attempting to move the master, tempdb, msdb, and model. After I added the –c option, -m option, and set trace flag 3608, and restarted, I got Error: 18461 when attempting to either connect via SSMS or sqlcmd in the consol. I had no idea what the problem was. Here is how it all played out;&lt;br /&gt;&lt;br /&gt;I logged onto the Database Server remotely. In the SQL Server Configuration Manager, I added the –c option, the –m option, and set trace flag 3608 in Startup Parameters with (;-c;-m;-T3608).&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;img id="BLOGGER_PHOTO_ID_5306757207203591074" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 258px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_p-E9D6bFkUY/SaVjkESdM6I/AAAAAAAAAAM/JpPpgZcsjiM/s320/SQLblog01.JPG" border="0" /&gt;I stopped all SQL Services (SSIS, FullText, Analysis Services, Reporting, SQL Server Browser, and SQL Agent) and restarted SQL Server (MSSQLSERVER).&lt;br /&gt;&lt;br /&gt;When I attempted to connect via SSMS or sqlcmd in the consol, I receive the following error;&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#ff0000;"&gt;Login failed for user 'cmcdonald'. Reason: Server is in single user mode. Only one administrator can connect at this time. (Microsoft SQL Server, Error: 18461)&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Then I attempted to login with Dedicated Administration Connection (DAC). I did this by opening SSMS window without connecting to a SQL Server. Then I clicked on the Database Engine Query button .&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5306757532723336754" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 271px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_p-E9D6bFkUY/SaVj3A8aVjI/AAAAAAAAAAU/6-xjBkBlgqc/s320/SQLblog02.JPG" border="0" /&gt;Next, I added &lt;em&gt;ADMIN:&lt;/em&gt; and the name of my SQL Server Instance.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;img id="BLOGGER_PHOTO_ID_5306757894870100402" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 238px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_p-E9D6bFkUY/SaVkMGC7abI/AAAAAAAAAAc/KGwIl0-teyg/s320/SQLblog03.JPG" border="0" /&gt;When I clicked Connect, I was connected to the instance. You can also connect with sqlcmd: &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;em&gt;sqlcmd -A -d testDB -E -S \namedinstance&lt;/em&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;-A is for the DAC&lt;br /&gt;-d is for the database&lt;br /&gt;-E is for integrated security&lt;br /&gt;-S is for the instance (in this example, a named instance)&lt;br /&gt;&lt;br /&gt;Now I begin moving system databases starting with the &lt;strong&gt;model&lt;/strong&gt; database.&lt;br /&gt;&lt;br /&gt;1. Detach the &lt;strong&gt;model &lt;/strong&gt;database by using the following commands: &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#3333ff;"&gt;use &lt;span style="color:#000000;"&gt;master &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;go&lt;br /&gt;sp_detach_db &lt;span style="color:#ff0000;"&gt;'model’ &lt;/span&gt;&lt;br /&gt;go&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;2. Move the Model.mdf and Modellog.ldf files from the D:\Mssql7\Data folder to the E:\Sqldata folder. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;3. Reattach the model database by using the following commands:&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#3333ff;"&gt;use &lt;/span&gt;&lt;span style="color:#000000;"&gt;master &lt;/span&gt;&lt;br /&gt;go&lt;br /&gt;&lt;span style="color:#990000;"&gt;sp_attach_db&lt;/span&gt; &lt;/em&gt;&lt;em&gt;&lt;span style="color:#cc0000;"&gt;&lt;span style="color:#ff0000;"&gt;'model','E:\Sqldata\model.mdf','E:\Sqldata\modellog.ldf'&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;go&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;4. Remove &lt;strong&gt;-c -m -T3608&lt;/strong&gt; from the startup parameters in SQL Server Configuration Manager. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;5. Stop and then restart SQL Server. You can verify the change in file locations by using the &lt;strong&gt;sp_helpfile&lt;/strong&gt; stored procedure. For example, use the following command:&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#3333ff;"&gt;use&lt;/span&gt; model&lt;br /&gt;go&lt;br /&gt;&lt;span style="color:#990000;"&gt;sp_helpfile&lt;/span&gt;&lt;br /&gt;go&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Next, moved the &lt;strong&gt;msdb&lt;/strong&gt; database. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;1. Add &lt;strong&gt;-c -m -T3608&lt;/strong&gt;(;-c;-m;-T3608) in the startup parameters in the SQL Server Configuration Manager and then restart SQL Server. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;2. Make sure that the SQL Server Agent service is not currently running. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;3. Log in with DAC and detach the &lt;strong&gt;msdb &lt;/strong&gt;database as follows: &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#3333ff;"&gt;use &lt;/span&gt;&lt;span style="color:#000000;"&gt;master&lt;br /&gt;&lt;/span&gt;go&lt;br /&gt;&lt;span style="color:#990000;"&gt;sp_detach_db&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;'msdb' &lt;/span&gt;&lt;br /&gt;go&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Note:&lt;/strong&gt; If your login fails, you may need to restart the windows server. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;4. Move the Msdbdata.mdf and Msdblog.ldf files from the current location (D:\Mssql8\Data) to the new location (E:\Mssql8\Data). &lt;/p&gt;&lt;p&gt;&lt;br /&gt;5. Remove &lt;strong&gt;-c -m -T3608&lt;/strong&gt; from the startup parameters box in Enterprise Manager. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;6. Then stop and restart SQL Server. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;7. Reattach the msdb database as follows: &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;&lt;em&gt;use &lt;/em&gt;&lt;/span&gt;&lt;em&gt;&lt;span style="color:#000000;"&gt;master&lt;br /&gt;&lt;/span&gt;go&lt;br /&gt;s&lt;span style="color:#990000;"&gt;p_attach_db&lt;/span&gt; &lt;/em&gt;&lt;em&gt;&lt;span style="color:#ff0000;"&gt;'msdb','E:\Sqldata\msdbdata.mdf’,'E:\Sqldata\msdblog.ldf’&lt;br /&gt;&lt;/span&gt;go&lt;/em&gt; &lt;/p&gt;&lt;br /&gt;To moved the &lt;strong&gt;master &lt;/strong&gt;database, do the following;&lt;br /&gt;&lt;br /&gt;1. Change the path for the master data files and the master log files in SQL Server Enterprise Manager. &lt;strong&gt;Note:&lt;/strong&gt; You may also change the location of the error log here.&lt;br /&gt;&lt;br /&gt;2. Right-click the SQL Server in Enterprise Manager and then click &lt;strong&gt;Properties&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;3. Click &lt;strong&gt;Startup Parameters&lt;/strong&gt; to see the following entries:&lt;br /&gt;&lt;br /&gt;&lt;em&gt;-dD:\MSSQL7\data\master.mdf &lt;/em&gt;&lt;br /&gt;&lt;em&gt;-eD:\MSSQL7\log\ErrorLog &lt;/em&gt;&lt;br /&gt;&lt;em&gt;-lD:\MSSQL7\data\mastlog.ldf&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;-d&lt;/strong&gt; is the fully qualified path for the master database data file.&lt;br /&gt;&lt;strong&gt;-e&lt;/strong&gt; is the fully qualified path for the error log file.&lt;br /&gt;&lt;strong&gt;-l&lt;/strong&gt; is the fully qualified path for the master database log file.&lt;br /&gt;&lt;br /&gt;4. Change these values as follows:&lt;br /&gt;&lt;br /&gt;a. Remove the current entries for the Master.mdf and Mastlog.ldf files.&lt;br /&gt;&lt;br /&gt;b. Add new entries specifying the new location.&lt;br /&gt;&lt;br /&gt;c.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;-dE:\SQLDATA\master.mdf &lt;/em&gt;&lt;br /&gt;&lt;em&gt;-lE:\SQLDATA\mastlog.ldf&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;5. Stop SQL Server.&lt;br /&gt;6. Copy the Master.mdf and Mastlog.ldf files to the new location (E:\Sqldata).&lt;br /&gt;7. Restart SQL Server.&lt;br /&gt;&lt;br /&gt;Move &lt;strong&gt;tempdb&lt;/strong&gt; files by using the ALTER DATABASE statement.&lt;br /&gt;&lt;br /&gt;1. Determine the logical file names for the &lt;strong&gt;tempdb&lt;/strong&gt; database by using &lt;strong&gt;sp_helpfile&lt;/strong&gt; as follows:&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#3333ff;"&gt;use&lt;/span&gt; tempdb&lt;br /&gt;go&lt;br /&gt;&lt;/em&gt;&lt;em&gt;&lt;span style="color:#990000;"&gt;sp_helpfile&lt;br /&gt;&lt;/span&gt;go&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;&lt;em&gt;-- tempdev 1 G:\MSSQL\tempdb.mdf PRIMARY&lt;br /&gt;-- templog 2 G:\MSSQL\templog.ldf NULL&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The logical name for each file is contained in the &lt;strong&gt;name&lt;/strong&gt; column. This example uses the default file names of &lt;strong&gt;tempdev&lt;/strong&gt; and &lt;strong&gt;templog&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;2. Use the ALTER DATABASE statement, specifying the logical file name as follows:&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#3333ff;"&gt;use&lt;/span&gt; master&lt;br /&gt;go&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;Alter database&lt;/span&gt; tempdb modify &lt;span style="color:#3333ff;"&gt;file &lt;/span&gt;(&lt;span style="color:#3333ff;"&gt;name&lt;/span&gt; = tempdev, &lt;span style="color:#3333ff;"&gt;filename &lt;/span&gt;= &lt;span style="color:#ff0000;"&gt;' E:\Sqldata\tempdb.mdf'&lt;/span&gt;)&lt;br /&gt;go&lt;br /&gt;&lt;span style="color:#3333ff;"&gt;Alter database&lt;/span&gt; tempdb modify &lt;span style="color:#3333ff;"&gt;file&lt;/span&gt; (&lt;span style="color:#3333ff;"&gt;name&lt;/span&gt; = templog, &lt;span style="color:#3333ff;"&gt;filename &lt;/span&gt;= &lt;span style="color:#ff0000;"&gt;' E:\Sqldata\templog.ldf'&lt;/span&gt;)&lt;/em&gt;&lt;br /&gt;&lt;em&gt;go&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;You should receive the following messages that confirm the change:&lt;br /&gt;&lt;br /&gt;Message 1&lt;br /&gt;&lt;br /&gt;&lt;em&gt;File 'tempdev' modified in sysaltfiles. Delete old file after restarting SQL Server.&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Message 2&lt;br /&gt;&lt;br /&gt;&lt;em&gt;File 'templog' modified in sysaltfiles. Delete old file after restarting SQL Server.&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;3. Using &lt;strong&gt;sp_helpfile&lt;/strong&gt; in &lt;strong&gt;tempdb&lt;/strong&gt; will not confirm these changes until you restart SQL Server.&lt;br /&gt;&lt;br /&gt;4. Stop and then restart SQL Server.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here are some helpful links;&lt;br /&gt;&lt;br /&gt;Moving System Databases: &lt;a href="http://support.microsoft.com/kb/224071"&gt;http://support.microsoft.com/kb/224071&lt;/a&gt;&lt;br /&gt;Using DAC: &lt;a href="http://msdn.microsoft.com/en-us/library/ms178068.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms178068.aspx&lt;/a&gt;&lt;br /&gt;SQL Server Startup Options: &lt;a href="http://msdn.microsoft.com/en-us/library/ms190737.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms190737.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4103619847444885405-4209745619808880924?l=claysql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claysql.blogspot.com/feeds/4209745619808880924/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claysql.blogspot.com/2009/02/receiving-error-18461-when-attempting.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/4209745619808880924'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/4209745619808880924'/><link rel='alternate' type='text/html' href='http://claysql.blogspot.com/2009/02/receiving-error-18461-when-attempting.html' title='Receiving Error: 18461 When Attempting to Move System Databases'/><author><name>Clay McDonald</name><uri>http://www.blogger.com/profile/00861387900854837549</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://1.bp.blogspot.com/_p-E9D6bFkUY/SaVuWj-vwYI/AAAAAAAAAAo/bZ0v1BRWtJE/S220/IMG00060.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_p-E9D6bFkUY/SaVjkESdM6I/AAAAAAAAAAM/JpPpgZcsjiM/s72-c/SQLblog01.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4103619847444885405.post-3186636042637242287</id><published>2008-12-12T11:59:00.000-08:00</published><updated>2008-12-12T12:18:57.875-08:00</updated><title type='text'>First Post</title><content type='html'>Hello! My name is Clay McDonald. I’ve been developing databases for 10 years now and thought it was about time to start sharing some of what I have learned. I’ll try to post at least once a week.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4103619847444885405-3186636042637242287?l=claysql.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://claysql.blogspot.com/feeds/3186636042637242287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://claysql.blogspot.com/2008/12/first-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/3186636042637242287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4103619847444885405/posts/default/3186636042637242287'/><link rel='alternate' type='text/html' href='http://claysql.blogspot.com/2008/12/first-post.html' title='First Post'/><author><name>Clay McDonald</name><uri>http://www.blogger.com/profile/00861387900854837549</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='23' height='32' src='http://1.bp.blogspot.com/_p-E9D6bFkUY/SaVuWj-vwYI/AAAAAAAAAAo/bZ0v1BRWtJE/S220/IMG00060.jpg'/></author><thr:total>0</thr:total></entry></feed>
