<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>soundripple</title>
	<atom:link href="http://soundripple.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://soundripple.com</link>
	<description>it's all just data</description>
	<lastBuildDate>Wed, 21 Oct 2009 15:13:26 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='soundripple.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/ed2524ddb937273104a14911e816f693?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
		<title>soundripple</title>
		<link>http://soundripple.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://soundripple.com/osd.xml" title="soundripple" />
	<atom:link rel='hub' href='http://soundripple.com/?pushpress=hub'/>
		<item>
		<title>Word 2007 Document Language Change</title>
		<link>http://soundripple.com/2009/10/21/word-2007-document-language-change/</link>
		<comments>http://soundripple.com/2009/10/21/word-2007-document-language-change/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 15:13:26 +0000</pubDate>
		<dc:creator>soundripple</dc:creator>
				<category><![CDATA[word]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[office]]></category>

		<guid isPermaLink="false">http://soundripple.com/?p=126</guid>
		<description><![CDATA[I frequently have to switch between working on documents for a UK/NZ/US audience, and often want to change the document&#8217;s language to match.
Spelling has never been an issue for me, but there&#8217;s something just wrong with having the document set to a language different to what you&#8217;re writing.  Words like &#8216;colour&#8217; and &#8216;neighbour&#8217; get the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=soundripple.com&blog=6360666&post=126&subd=soundripple&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I frequently have to switch between working on documents for a UK/NZ/US audience, and often want to change the document&#8217;s language to match.</p>
<p>Spelling has never been an issue for me, but there&#8217;s something just <em>wrong</em> with having the document set to a language different to what you&#8217;re writing.  Words like &#8216;colour&#8217; and &#8216;neighbour&#8217; get the annoying red squiggle, and it&#8217;s irritating that real typos get mixed in with the (ahem) original English spellings of words.  Every now and then I have to work out how to beat this, and I always forget, so think of this as a note-to-self that may be useful to others too.</p>
<p>Some googling will tell you that the most common solution is to do a select-all (ctrl-A), then use the language selector in the status bar (or in the Review ribbon).  This only sets the selected text, though, and you&#8217;ll have to re-do it every time you add new text.  How could that ever be good enough?</p>
<p>Another solution you&#8217;ll see is to change the default language for the Normal template by clicking the &#8216;Default&#8230;&#8217; button in the language dialog.  As far as I know, this will affect all new documents from that point on &#8211; obviously crazy talk.</p>
<p>Fortunately, there&#8217;s a way that feels a lot more <em>right</em>, in that it changes the entire document (but just the current document), and any new text that you add.  It&#8217;s easy to do at any time during the document editing process, and you don&#8217;t have to keep reapplying it.</p>
<p><strong>It just boils down to changing the Normal style for the current document.</strong> Not for the next document, or all future documents, or all the documents in your housing subdivision&#8230; just for this one.  Steps are easy:</p>
<p>1. From the &#8216;Home&#8217; ribbon, open the style editor:</p>
<p style="text-align:center;">
<div id="attachment_127" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-127 " title="Step 1" src="http://soundripple.files.wordpress.com/2009/10/language_change_step01.png?w=500&#038;h=111" alt="Open the Style Editor" width="500" height="111" /><p class="wp-caption-text">Open the Style Editor</p></div>
<p>2. Modify the Normal style:</p>
<div id="attachment_128" class="wp-caption aligncenter" style="width: 301px"><img class="size-full wp-image-128" title="Step 2" src="http://soundripple.files.wordpress.com/2009/10/language_change_step02.png?w=291&#038;h=240" alt="Modify the Normal Style" width="291" height="240" /><p class="wp-caption-text">Modify the Normal Style</p></div>
<p>3. Change the language:</p>
<div id="attachment_129" class="wp-caption aligncenter" style="width: 349px"><img class="size-full wp-image-129" title="Step 3" src="http://soundripple.files.wordpress.com/2009/10/language_change_step03.png?w=339&#038;h=571" alt="Change the language" width="339" height="571" /><p class="wp-caption-text">Change the language</p></div>
<p>Select the language you need, and you&#8217;ll notice that it appears in the description of the style (see the screenshot above).  A nice side affect is that most (all?) of the other styles are based on Normal, so they get the change too.</p>
<p>Finally, just OK your way back out to the document.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/soundripple.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/soundripple.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/soundripple.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/soundripple.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/soundripple.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/soundripple.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/soundripple.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/soundripple.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/soundripple.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/soundripple.wordpress.com/126/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=soundripple.com&blog=6360666&post=126&subd=soundripple&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://soundripple.com/2009/10/21/word-2007-document-language-change/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c556330076dacddeaa432d3cdadb6a0d?s=96&#38;d=http%3A%2F%2Fa.wordpress.com%2Fi%2Fmu.gif&#38;r=PG" medium="image">
			<media:title type="html">soundripple</media:title>
		</media:content>

		<media:content url="http://soundripple.files.wordpress.com/2009/10/language_change_step01.png" medium="image">
			<media:title type="html">Step 1</media:title>
		</media:content>

		<media:content url="http://soundripple.files.wordpress.com/2009/10/language_change_step02.png" medium="image">
			<media:title type="html">Step 2</media:title>
		</media:content>

		<media:content url="http://soundripple.files.wordpress.com/2009/10/language_change_step03.png" medium="image">
			<media:title type="html">Step 3</media:title>
		</media:content>
	</item>
		<item>
		<title>Calculated Outlook Column: Lag</title>
		<link>http://soundripple.com/2009/08/11/calculated-outlook-column-lag/</link>
		<comments>http://soundripple.com/2009/08/11/calculated-outlook-column-lag/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 19:33:21 +0000</pubDate>
		<dc:creator>soundripple</dc:creator>
				<category><![CDATA[outlook]]></category>

		<guid isPermaLink="false">http://soundripple.com/?p=115</guid>
		<description><![CDATA[We recently started getting a slowdown in our mail at work, and didn&#8217;t spot it until people started calling (and even sending other emails) to ask the singularly most overused question of all time: &#8220;Did you get my email?&#8221;
I figured it must be easy enough to display the message lag in Outlook somehow, so that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=soundripple.com&blog=6360666&post=115&subd=soundripple&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_121" class="wp-caption alignright" style="width: 294px"><img class="size-full wp-image-121 " title="Lag Field" src="http://soundripple.files.wordpress.com/2009/08/outlook_lag_result.png?w=284&#038;h=287" alt="Lag Field" width="284" height="287" /><p class="wp-caption-text">Lag Field</p></div>
<p>We recently started getting a slowdown in our mail at work, and didn&#8217;t spot it until people started calling (and even sending other emails) to ask the singularly most overused question of all time: &#8220;Did you get my email?&#8221;</p>
<p>I figured it must be easy enough to display the message lag in Outlook somehow, so that performance problems become more apparent.  It turns out to be even easier than you&#8217;d expect; all you need is a calculated field to display the difference between the Sent and Received fields:</p>
<p>Note:</p>
<ul>
<li>&#8216;Sent&#8217; means the time that the sender&#8217;s client (e.g. Outlook) sent the message, and it is displayed in your local time zone.  Technical description <a href="http://msdn.microsoft.com/en-us/library/cc839781.aspx">here</a>.</li>
<li>&#8216;Received&#8217; means the time that the message hit your mail server (in our case this is Exchange), and is also displayed in your local time zone.  Technical description <a href="http://msdn.microsoft.com/en-us/library/cc841961.aspx">here</a>.</li>
</ul>
<p>I&#8217;m working in Outlook 2007, so the screens below may look slightly different at your end.</p>
<p>I set the field to show as &#8216;h:mm:ss&#8217;, but of course this could be shown in any number of ways.</p>
<p>Step 1: Create a new user-defined field.  Right-click anywhere in the header bar and select &#8220;Field Chooser&#8221;:</p>
<div id="attachment_116" class="wp-caption aligncenter" style="width: 302px"><img class="size-full wp-image-116" title="Step 1" src="http://soundripple.files.wordpress.com/2009/08/outlook_lag_step01.png?w=292&#038;h=289" alt="Step 1" width="292" height="289" /><p class="wp-caption-text">Step 1</p></div>
<p>Step 2: In the Field Chooser, select &#8221; User-defined fields in folder&#8221; (or &#8220;&#8230;in Inbox&#8221; if you&#8217;re working in the inbox):</p>
<div id="attachment_117" class="wp-caption aligncenter" style="width: 204px"><img class="size-full wp-image-117" title="Step 2" src="http://soundripple.files.wordpress.com/2009/08/outlook_lag_step02.png?w=194&#038;h=324" alt="outlook_lag_step02" width="194" height="324" /><p class="wp-caption-text">Step 2</p></div>
<p style="text-align:center;">
<p>Step 3: Name the new field &#8220;Lag&#8221; (or whatever you prefer), and select a type of &#8216;Formula&#8217;:</p>
<div id="attachment_118" class="wp-caption aligncenter" style="width: 304px"><img class="size-full wp-image-118" title="Step 3" src="http://soundripple.files.wordpress.com/2009/08/outlook_lag_step03.png?w=294&#038;h=158" alt="Step 3" width="294" height="158" /><p class="wp-caption-text">Step 3</p></div>
<p>Step 4: Paste in the following formula:<br />
<code>format(Hour([Received]-[Sent]),"0") &amp; ":" &amp; Format(Minute([Received]-[Sent]),"00") &amp; ":" &amp; format(Second([Received]-[Sent]),"00")</code></p>
<div id="attachment_119" class="wp-caption aligncenter" style="width: 425px"><img class="size-full wp-image-119" title="Step 4" src="http://soundripple.files.wordpress.com/2009/08/outlook_lag_step04.png?w=415&#038;h=268" alt="Step 4" width="415" height="268" /><p class="wp-caption-text">Step 4</p></div>
<p>Step 5: Drop the new field into your header bar, wherever you want it to display:</p>
<div id="attachment_120" class="wp-caption aligncenter" style="width: 363px"><img class="size-full wp-image-120" title="Step 5" src="http://soundripple.files.wordpress.com/2009/08/outlook_lag_step05.png?w=353&#038;h=194" alt="Step 5" width="353" height="194" /><p class="wp-caption-text">Step 5</p></div>
<p>From there, you should be able to see the new &#8216;Lag&#8217; column.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/soundripple.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/soundripple.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/soundripple.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/soundripple.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/soundripple.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/soundripple.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/soundripple.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/soundripple.wordpress.com/115/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/soundripple.wordpress.com/115/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/soundripple.wordpress.com/115/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=soundripple.com&blog=6360666&post=115&subd=soundripple&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://soundripple.com/2009/08/11/calculated-outlook-column-lag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c556330076dacddeaa432d3cdadb6a0d?s=96&#38;d=http%3A%2F%2Fa.wordpress.com%2Fi%2Fmu.gif&#38;r=PG" medium="image">
			<media:title type="html">soundripple</media:title>
		</media:content>

		<media:content url="http://soundripple.files.wordpress.com/2009/08/outlook_lag_result.png" medium="image">
			<media:title type="html">Lag Field</media:title>
		</media:content>

		<media:content url="http://soundripple.files.wordpress.com/2009/08/outlook_lag_step01.png" medium="image">
			<media:title type="html">Step 1</media:title>
		</media:content>

		<media:content url="http://soundripple.files.wordpress.com/2009/08/outlook_lag_step02.png" medium="image">
			<media:title type="html">Step 2</media:title>
		</media:content>

		<media:content url="http://soundripple.files.wordpress.com/2009/08/outlook_lag_step03.png" medium="image">
			<media:title type="html">Step 3</media:title>
		</media:content>

		<media:content url="http://soundripple.files.wordpress.com/2009/08/outlook_lag_step04.png" medium="image">
			<media:title type="html">Step 4</media:title>
		</media:content>

		<media:content url="http://soundripple.files.wordpress.com/2009/08/outlook_lag_step05.png" medium="image">
			<media:title type="html">Step 5</media:title>
		</media:content>
	</item>
		<item>
		<title>Registering DLLs in Vista x64</title>
		<link>http://soundripple.com/2009/07/16/registering-dlls-in-vista-x64/</link>
		<comments>http://soundripple.com/2009/07/16/registering-dlls-in-vista-x64/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 15:24:44 +0000</pubDate>
		<dc:creator>soundripple</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://soundripple.com/?p=110</guid>
		<description><![CDATA[I recently migrated from 32-bit XP to 64-bit Vista.  It was a bit of a shock, and I&#8217;m still trying to find my way around some of the differences; One of the more problematic issues I found is setting up legacy 32-bit apps, since these have DLLs that need to go into the appropriate [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=soundripple.com&blog=6360666&post=110&subd=soundripple&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I recently migrated from 32-bit XP to 64-bit Vista.  It was a bit of a shock, and I&#8217;m still trying to find my way around some of the differences; One of the more problematic issues I found is setting up legacy 32-bit apps, since these have DLLs that need to go into the appropriate System folder.  The app that prompted this post uses a batch file to copy DLL and OCX files into C:\Windows\System32, then uses the system reg tool to register the files.</p>
<p>In 32-bit XP, you have:<br />
C:\Windows\System <em>- contains 16-bit system files</em><br />
C:\Windows\System32 <em>- contains 32-bit system files</em></p>
<p>In 64-bit Vista, you have:<br />
C:\Windows\System32 <em>- contains 64-bit system files</em><br />
C:\Windows\SysWOW64 <em>- contains 32-bit system files</em></p>
<p>Niiiice.  </p>
<p>First thing was getting an easy way to run the RegSvr32.exe elevated, easily.<br />
I ended up copying the entire file from<br />
C:\Windows\System32\regsvr32.exe<br />
to<br />
C:\Users\\AppData\Roaming\Microsoft\Windows\SendTo\regsvr32.exe</p>
<p>I then edited the properties (of the copy in SendTo) to &#8216;Run as Administrator&#8217;.<br />
Then, to register anything, just select the DLL or OCX file, right-click, Send To, regsvr32.exe.  You can even select more than one file at a time, and you only get the one UAC prompt.</p>
<p>Next issue was the location for files.  The app I installed copied all its DLLs and OCXs into System32, and then promptly failed when it tried to register them, with:<br />
<code>LoadLibrary failed : 0x8007007E (The specified module could not be found. )</code></p>
<p>I found the solution to this was to move the files from System32 into SysWOW64.  Then, the register action magically worked.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/soundripple.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/soundripple.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/soundripple.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/soundripple.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/soundripple.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/soundripple.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/soundripple.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/soundripple.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/soundripple.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/soundripple.wordpress.com/110/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=soundripple.com&blog=6360666&post=110&subd=soundripple&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://soundripple.com/2009/07/16/registering-dlls-in-vista-x64/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c556330076dacddeaa432d3cdadb6a0d?s=96&#38;d=http%3A%2F%2Fa.wordpress.com%2Fi%2Fmu.gif&#38;r=PG" medium="image">
			<media:title type="html">soundripple</media:title>
		</media:content>
	</item>
		<item>
		<title>Moving to Origin in AutoCAD</title>
		<link>http://soundripple.com/2009/06/23/moving-to-origin-in-autocad/</link>
		<comments>http://soundripple.com/2009/06/23/moving-to-origin-in-autocad/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 22:11:54 +0000</pubDate>
		<dc:creator>soundripple</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://soundripple.com/?p=107</guid>
		<description><![CDATA[This is something that drives me nuts every time I try to do it.  Our AutoCAD guy  is kind enough to show me the solution every time I hit it (because my memory is so fantastic), but I figured that THIS time I&#8217;ll blog it so I can look it up next time [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=soundripple.com&blog=6360666&post=107&subd=soundripple&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>This is something that drives me nuts every time I try to do it.  Our AutoCAD guy  is kind enough to show me the solution every time I hit it (because my memory is so fantastic), but I figured that THIS time I&#8217;ll blog it so I can look it up next time I forget.</p>
<p>If you have something that you are trying to move to (0,0), you would THINK you just have to select it, type &#8216;M&#8217; for move, hit space, and enter &#8216;0&#8242;, comma, &#8216;0&#8242;, enter.</p>
<p>Bizarrely enough, it doesn&#8217;t, and I&#8217;ve even seen experienced AutoCAD dudes stumped by it.  The answer is simple: turn off Dynamic Input, either by clicking on the &#8216;DYN&#8217; slot in the status bar, or in the drafting options.<br />
Alternatively, change the dynamic input options for coordinates: in AutoCAD LT 2007, this is in<br />
Tools | Drafting Settings | Dynamic Input | Pointer Input Settings | Format: Absolute coordinates.</p>
<p>Whoosh!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/soundripple.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/soundripple.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/soundripple.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/soundripple.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/soundripple.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/soundripple.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/soundripple.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/soundripple.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/soundripple.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/soundripple.wordpress.com/107/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=soundripple.com&blog=6360666&post=107&subd=soundripple&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://soundripple.com/2009/06/23/moving-to-origin-in-autocad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c556330076dacddeaa432d3cdadb6a0d?s=96&#38;d=http%3A%2F%2Fa.wordpress.com%2Fi%2Fmu.gif&#38;r=PG" medium="image">
			<media:title type="html">soundripple</media:title>
		</media:content>
	</item>
		<item>
		<title>Reading SQL Server&#8217;s IMAGE Data Type</title>
		<link>http://soundripple.com/2009/06/16/reading-sql-servers-image-data-type/</link>
		<comments>http://soundripple.com/2009/06/16/reading-sql-servers-image-data-type/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 20:22:44 +0000</pubDate>
		<dc:creator>soundripple</dc:creator>
				<category><![CDATA[sql server]]></category>

		<guid isPermaLink="false">http://soundripple.com/?p=104</guid>
		<description><![CDATA[For the &#8220;something I always forget and have to search for&#8221; bucket: if you have an IMAGE data type in a table, and you want a quick-n-nasty way to read the contents, AND if it&#8217;s not more than 8000 characters:

select cast(cast(fieldName as varbinary(8000)) as varchar(8000))
FROM tablename

Told you it was quick, and told you it was [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=soundripple.com&blog=6360666&post=104&subd=soundripple&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>For the &#8220;something I always forget and have to search for&#8221; bucket: if you have an IMAGE data type in a table, and you want a quick-n-nasty way to read the contents, AND if it&#8217;s not more than 8000 characters:</p>
<pre class="brush: sql;">
select cast(cast(fieldName as varbinary(8000)) as varchar(8000))
FROM tablename
</pre>
<p>Told you it was quick, and told you it was nasty <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/soundripple.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/soundripple.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/soundripple.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/soundripple.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/soundripple.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/soundripple.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/soundripple.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/soundripple.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/soundripple.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/soundripple.wordpress.com/104/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=soundripple.com&blog=6360666&post=104&subd=soundripple&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://soundripple.com/2009/06/16/reading-sql-servers-image-data-type/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c556330076dacddeaa432d3cdadb6a0d?s=96&#38;d=http%3A%2F%2Fa.wordpress.com%2Fi%2Fmu.gif&#38;r=PG" medium="image">
			<media:title type="html">soundripple</media:title>
		</media:content>
	</item>
		<item>
		<title>Liz&#8217;s Birthday: Triathlon Cake</title>
		<link>http://soundripple.com/2009/05/24/lizs-birthday-triathlon-cake/</link>
		<comments>http://soundripple.com/2009/05/24/lizs-birthday-triathlon-cake/#comments</comments>
		<pubDate>Sun, 24 May 2009 19:00:27 +0000</pubDate>
		<dc:creator>soundripple</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://soundripple.com/?p=94</guid>
		<description><![CDATA[Liz&#8217;s birthday was this week, and she said she wanted the chocolate cake from the Joy of Vegan Baking.  It&#8217;s amazingly easy to make, we&#8217;ve used it for a few occasions, and always comes out really well.
I really wanted to decorate it in a way that means something to her, and at the same time [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=soundripple.com&blog=6360666&post=94&subd=soundripple&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Liz&#8217;s birthday was this week, and she said she wanted the chocolate cake from the <em>Joy of Vegan Baking</em>.  It&#8217;s amazingly easy to make, we&#8217;ve used it for a few occasions, and always comes out really well.</p>
<p>I really wanted to decorate it in a way that means something to her, and at the same time was worried, because I don&#8217;t have much of a steady hand when it comes to icing a cake.  A quick Google image search for &#8216;bicycle cake&#8217; confirmed my fears &#8211; unless you&#8217;re a pastry chef, there&#8217;s precious little chance of making something that looks like a bike!</p>
<p>I had been thinking about other ways of decorating it, and then Liz&#8217;s coworker made her a beautiful <a href="http://www.flickr.com/photos/speedvegan/3550832079/">fondant covered cake</a>, which got me to thinking that maybe I could use fondant to achieve what I wanted, since it would let me cut stuff and arrange it before I put it on the cake (the finality of icing bags makes me nervous!  One twitch, and your cake changes from a picture of a bike into something postmodern and vaguely frightening).  A bit of looking around confirmed that you either make fondant from gelatin and sugar, or cooked marshmallows (aka, gelatin and sugar).  There are some vegan recipes out there, but they all looked either tricky or unreliable, and I didn&#8217;t find many people saying that fondant was actually delicious regardless of how you make it.</p>
<p>So, the logical conclusion was marzipan, which has always seemed entirely delicious to me, and is something that I know Liz likes.  Luckily, based on the numbers coming to the party, we needed three cakes (I can&#8217;t imagine the cosmic connection between the number of people at a party and the number of events in a triathlon, but I&#8217;m sure it&#8217;s there!).  And, not only that  &#8211; I had a mix of cake pan sizes (two eight-inch, one nine-inch) , and Liz&#8217;s favourite thing ever is the bike event, which falls in the middle of the famous &#8217;swim, bike, run&#8217;, so that got the larger cake and saved the symmetry.</p>
<p><a title="The Cake by cloudmonkey, on Flickr" href="http://www.flickr.com/photos/cloudmonkey/3560420914/"><img src="http://farm4.static.flickr.com/3604/3560420914_bb4d14e32f.jpg" alt="The Cake" width="490px" style="border:1px solid gray;padding:3px;" /></a></p>
<p>Anyway, the result came out just how I wanted it &#8211; and Liz seemed happy too, which is of course the whole point.  Happy birthday baby!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/soundripple.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/soundripple.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/soundripple.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/soundripple.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/soundripple.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/soundripple.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/soundripple.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/soundripple.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/soundripple.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/soundripple.wordpress.com/94/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=soundripple.com&blog=6360666&post=94&subd=soundripple&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://soundripple.com/2009/05/24/lizs-birthday-triathlon-cake/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c556330076dacddeaa432d3cdadb6a0d?s=96&#38;d=http%3A%2F%2Fa.wordpress.com%2Fi%2Fmu.gif&#38;r=PG" medium="image">
			<media:title type="html">soundripple</media:title>
		</media:content>

		<media:content url="http://farm4.static.flickr.com/3604/3560420914_bb4d14e32f.jpg" medium="image">
			<media:title type="html">The Cake</media:title>
		</media:content>
	</item>
		<item>
		<title>Scroll-Lock on the XPS M1340</title>
		<link>http://soundripple.com/2009/05/20/scroll-lock-on-the-xps-m1340/</link>
		<comments>http://soundripple.com/2009/05/20/scroll-lock-on-the-xps-m1340/#comments</comments>
		<pubDate>Wed, 20 May 2009 21:59:03 +0000</pubDate>
		<dc:creator>soundripple</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://soundripple.com/?p=91</guid>
		<description><![CDATA[Looking for the archaic old scroll-lock on the Studio XPS 13?  It&#8217;s not labeled on the keyboard, but you can use Fn-F5.
I use it as an Outlook macro &#8216;modifier&#8217;; I use a macro to delay all my messages by two minutes, unless the scroll-lock is on when I send the message (at which point I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=soundripple.com&blog=6360666&post=91&subd=soundripple&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Looking for the archaic old scroll-lock on the Studio XPS 13?  It&#8217;s not labeled on the keyboard, but you can use <strong>Fn-F5</strong>.</p>
<p>I use it as an Outlook macro &#8216;modifier&#8217;; I use a macro to delay all my messages by two minutes, unless the scroll-lock is on when I send the message (at which point I allow the message to be sent immediately, and turn off the scroll-lock).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/soundripple.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/soundripple.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/soundripple.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/soundripple.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/soundripple.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/soundripple.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/soundripple.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/soundripple.wordpress.com/91/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/soundripple.wordpress.com/91/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/soundripple.wordpress.com/91/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=soundripple.com&blog=6360666&post=91&subd=soundripple&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://soundripple.com/2009/05/20/scroll-lock-on-the-xps-m1340/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c556330076dacddeaa432d3cdadb6a0d?s=96&#38;d=http%3A%2F%2Fa.wordpress.com%2Fi%2Fmu.gif&#38;r=PG" medium="image">
			<media:title type="html">soundripple</media:title>
		</media:content>
	</item>
		<item>
		<title>Migrating SQL Server Databases (Part II)</title>
		<link>http://soundripple.com/2009/05/20/migrating-sql-server-databases-part-ii/</link>
		<comments>http://soundripple.com/2009/05/20/migrating-sql-server-databases-part-ii/#comments</comments>
		<pubDate>Wed, 20 May 2009 17:56:32 +0000</pubDate>
		<dc:creator>soundripple</dc:creator>
				<category><![CDATA[sql server]]></category>

		<guid isPermaLink="false">http://soundripple.com/?p=84</guid>
		<description><![CDATA[Yesterday I posted a script to back up and compress all the user databases on a server.  Today, faced with restoring them one-by-one, I decided it was worth having  a stab at automating the process.
It turns out that SQL Mag posted an article on something pretty much exactly what I needed.  I took their code [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=soundripple.com&blog=6360666&post=84&subd=soundripple&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Yesterday I <a href="http://soundripple.com/2009/05/19/migrating-sql-server-databases/">posted</a> a script to back up and compress all the user databases on a server.  Today, faced with restoring them one-by-one, I decided it was worth having  a stab at automating the process.</p>
<p>It turns out that SQL Mag posted an <a href="http://www.sqlmag.com/Article/ArticleID/46560/sql_server_46560.html">article</a> on something pretty much exactly what I needed.  I took their code and tweaked it a bit &#8211; mainly to change it from a Stored Procedure into a utility script (I&#8217;m not interested in having it live in the DB), and to correct a couple of problems for when it&#8217;s used against SQL Server 2005.  I also added a small section to fix the users on each DB as it is restored; I didn&#8217;t do anything fancy or rigorous like iterating the users, since I know what mine are in advance (same for all DBs).   I also set it to use the DB name for both the .mdf and .ldf, and as a side-effect it doesn&#8217;t support multiple data containers (mdf, ndf, etc).</p>
<p>Here&#8217;s the code, anyway; change the section near the top to point to your required directories (@backupDir and @dataDir).</p>
<pre class="brush: sql;">
--turn on the ability to run commands from T-SQL, only needed if we're in version 9 (SQL Server 2005) or later
if (select substring(@@version, charindex(' - ', @@version) + 3, charindex('.', @@version) - charindex(' - ', @@version) - 3)) &gt; 8
begin
 exec sp_configure 'show advanced options', 1
 reconfigure
 exec sp_configure 'xp_cmdshell', 1
 reconfigure
end

declare @dbname   sysname
declare @dbshort  sysname
declare @line     varchar(100)
declare @reststmt    varchar(600)
declare @ntstmt   varchar(100)
declare @datafilename sysname
declare @logfilename sysname
declare @i        int
declare @pos1     int
declare @backupDir    varchar(600)
declare @dataDir    varchar(600)

--Setup these two lines to point to appropriate locations.
--BackupDir is the location of your .BAK files, and dataDir is the location you want to store your DBs.
--Both must NOT have trailing backslash, neither should have spaces in path (use 8.3 format if necessary)
select @backupDir = 'c:\database\backup\migrate'
select @dataDir = 'c:\database'

set nocount on
IF OBJECT_ID('tempdb..#listfile') IS NOT NULL
 drop table #listfile
create table #listfile
 (LogicalName nvarchar(128),
 PhysicalName nvarchar(260),
 Type char(1),
 FileGroupName nvarchar(128),
 Size numeric(20,0),
 MaxSize numeric(20,0),
 FileID bigint,
 CreateLSN numeric(25,0),
 DropLSN numeric(25,0) null,
 UniqueID uniqueidentifier,
 ReadOnlyLSN numeric(25,0) null,
 ReadWriteLSN numeric(25,0) null,
 BackupSizeInBytes bigint,
 SourceBlockSize int,
 FileGroupID int,
 LogGroupGUID uniqueidentifier null,
 DifferentialBaseLSN numeric(25,0) null,
 DifferentialBaseGUID uniqueidentifier null,
 IsReadOnly bit,
 IsPresent bit
 )

IF OBJECT_ID('tempdb..#userdbs') IS NOT NULL
 drop table #userdbs
create table #userdbs
 (line varchar(100))

set @ntstmt = 'xp_cmdshell ' + char(39) + 'dir ' + @backupdir+ char(39)
insert into #userdbs exec (@ntstmt)
declare cdb cursor for select line from #userdbs where upper(line) like '%BAK%'

open cdb
fetch cdb into @line
while @@fetch_status = 0
begin
 set @pos1 = CharIndex('.bak' ,@line,1)
 set @i = @pos1
 while substring (@line,@i,1) &lt;&gt; ' ' and @i &gt; 1
 begin
 set @i = @i - 1
 end
 set @dbname = substring (@line,@i+1,@pos1+3-@i)
 set @dbshort = rtrim(ltrim(replace(@dbname,'.bak','')))

 truncate table #listfile
 insert into #listfile    exec ('RESTORE filelistonly from disk=' + '''' + @backupdir + '\' + @dbname  + '''')
--print 'RESTORE filelistonly from disk=' + '''' + @backupdir + '\' + @dbname  + ''''

 select @datafilename = LogicalName from #listfile where type = 'D'
 select @logfilename = LogicalName from #listfile where type = 'L'

 set @reststmt = 'restore Database ' + @dbshort + ' from ' +
 'Disk = ' + char(39) +@backupdir + '\' +
 rtrim(ltrim(@dbname)) + char(39)

 if Isnull (@dataDir,'*') &lt;&gt; '*'
 begin
 set @reststmt = @reststmt + ' with move ' + char(39) + @datafilename + char(39) +
 ' to ' + char(39) + @dataDir + '\' + @dbshort + '.mdf' + char(39) +
 ', move ' + char(39) + @logfilename + char(39) + ' to ' + char(39) +
 @dataDir + '\'  + @dbshort + '.ldf' + char(39)
 end
 print @reststmt
 exec (@reststmt)

 exec ('use ' + @dbshort + ' alter user v6user with login=v6user')
 exec ('use ' + @dbshort + ' alter user v6owner with login=v6owner')
 fetch cdb into @line
end 

close cdb
deallocate cdb
drop table #userdbs
drop table #listfile

if (select substring(@@version, charindex(' - ', @@version) + 3, charindex('.', @@version) - charindex(' - ', @@version) - 3)) &gt; 8
begin
 exec sp_configure 'xp_cmdshell', 0
 reconfigure
 exec sp_configure 'show advanced options', 0
 reconfigure
end
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/soundripple.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/soundripple.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/soundripple.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/soundripple.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/soundripple.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/soundripple.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/soundripple.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/soundripple.wordpress.com/84/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/soundripple.wordpress.com/84/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/soundripple.wordpress.com/84/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=soundripple.com&blog=6360666&post=84&subd=soundripple&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://soundripple.com/2009/05/20/migrating-sql-server-databases-part-ii/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c556330076dacddeaa432d3cdadb6a0d?s=96&#38;d=http%3A%2F%2Fa.wordpress.com%2Fi%2Fmu.gif&#38;r=PG" medium="image">
			<media:title type="html">soundripple</media:title>
		</media:content>
	</item>
		<item>
		<title>Migrating SQL Server Databases (Part I)</title>
		<link>http://soundripple.com/2009/05/19/migrating-sql-server-databases/</link>
		<comments>http://soundripple.com/2009/05/19/migrating-sql-server-databases/#comments</comments>
		<pubDate>Tue, 19 May 2009 20:46:27 +0000</pubDate>
		<dc:creator>soundripple</dc:creator>
				<category><![CDATA[sql server]]></category>

		<guid isPermaLink="false">http://soundripple.com/?p=74</guid>
		<description><![CDATA[I&#8217;m moving to a new laptop, and one of the more tedious tasks is backing up, moving, and restoring all my SQL Server databases (it&#8217;s quite a collection).
I figured it must be easy enough to automate, so that the entire backup process can happen overnight.  I don&#8217;t have enough space to back everything up [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=soundripple.com&blog=6360666&post=74&subd=soundripple&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m moving to a new laptop, and one of the more tedious tasks is backing up, moving, and restoring all my SQL Server databases (it&#8217;s quite a collection).</p>
<p>I figured it must be easy enough to automate, so that the entire backup process can happen overnight.  I don&#8217;t have enough space to back everything up and leave it uncompressed, so figured a T-SQL script was in order; something that will back up all user databases, compressing each and deleting the backup file.  A bit of searching turned up <a href="http://dbalink.wordpress.com/2008/07/12/how-to-create-dynamic-file-system-directory-in-tsql/">an example of how to use xp_cmdshell to run OS commands</a>, and <a href="http://blogs.mssqltips.com/forums/t/263.aspx">another script to do the actual backup</a>, so combining them yields a beast that will backup each DB, compress it (using 7-Zip), then delete the backup file.</p>
<p>A small note: according to the <a href="http://msdn.microsoft.com/en-us/library/aa260689%28SQL.80%29.aspx">docs</a>, a T-SQL <em>xp_cmdshell</em> command &#8220;cannot contain more than one set of double quotation marks. A single pair of quotation marks is required if any spaces are present in the file paths or program names referenced in command_string. If you have trouble with embedded spaces, consider using FAT 8.3 file names as a workaround.&#8221;<br />
Although this is a gigantic pain in the arse, you can of course work around it by either using paths that don&#8217;t include spaces, or by using the old 8.3 format as suggested.</p>
<p>Just change the two locations near the top of the script to point to your backup directory and your 7-Zip exe, and you should just be able to run the script.  To test it on just the first database, comment out the &#8216;while&#8217; line.  Oh, and make sure you install <a href="http://www.7-zip.org">7-Zip</a> of course.</p>
<p>I was going to write a similar script to do the reverse, based on iterating the directory contents and uncompressing / restoring each DB, but decided it wasn&#8217;t worth the time.  For those who are interested, there&#8217;s an example <a href="http://www.simple-talk.com/content/print.aspx?article=634">here</a> of how to iterate a directory, and you could easily reverse-engineer the below script to uncompress and restore instead.</p>
<p>Update: I gave in and set up a script for the restore too, see the post <a href="http://soundripple.com/2009/05/20/migrating-sql-server-databases-part-ii/">here</a>.</p>
<pre class="brush: sql;">
--turn on the ability to run commands from T-SQL, only needed if we're in version 9 (SQL Server 2005) or later
if (select substring(@@version, charindex(' - ', @@version) + 3, charindex('.', @@version) - charindex(' - ', @@version) - 3)) &gt; 8
begin
	exec sp_configure 'show advanced options', 1
	reconfigure
	exec sp_configure 'xp_cmdshell', 1
	reconfigure
end

declare @backupDir varchar(800)
declare @7zipExe varchar(800)
declare @backupName varchar(800)
declare @zipName varchar(800)
declare @cmd varchar(800)
declare @dbName varchar(200)

--Setup these two lines to point to appropriate locations.
--Dir must have trailing backslash, neither should have spaces in path (or use 8.3 format)
set @backupDir = 'C:\Database\Backup\migrate\'
set @7zipExe = 'C:\Progra~1\7-Zip\7z.exe'

declare db_cursor cursor for
	select name
	from master.dbo.sysdatabases
	where name not in ('master','model','msdb','tempdb') 

open db_cursor
fetch next from db_cursor into @dbName  

while @@FETCH_STATUS = 0
begin
	set @backupName = @backupDir + @dbName + '.BAK'
	set @zipName = @backupDir + @dbName + '.7z'
	print 'Backing up ' + @dbName
	backup database @dbName to disk = @backupName

	--In the following command-line: 'a' is add, '-t7z' is 7-zip native format, '-mx7' is compression level (9 is max), '-mmt' is use multithreading
	select @cmd = '&quot;' + @7zipExe + ' a -t7z -mx7 -mmt ' + @zipName + ' ' + @backupName + '&quot;'
	print 'Compressing ' + @dbName
	EXEC  master..xp_cmdshell @cmd, no_output

	select @cmd = 'del &quot;' + @backupName + '&quot;'
	print 'Deleting .bak file for ' + @dbName
	EXEC  master..xp_cmdshell @cmd, no_output

	fetch next from db_cursor into @dbName

end

close db_cursor
deallocate db_cursor

if (select substring(@@version, charindex(' - ', @@version) + 3, charindex('.', @@version) - charindex(' - ', @@version) - 3)) &gt; 8
begin
	exec sp_configure 'xp_cmdshell', 0
	reconfigure
	exec sp_configure 'show advanced options', 0
	reconfigure
end
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/soundripple.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/soundripple.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/soundripple.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/soundripple.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/soundripple.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/soundripple.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/soundripple.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/soundripple.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/soundripple.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/soundripple.wordpress.com/74/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=soundripple.com&blog=6360666&post=74&subd=soundripple&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://soundripple.com/2009/05/19/migrating-sql-server-databases/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c556330076dacddeaa432d3cdadb6a0d?s=96&#38;d=http%3A%2F%2Fa.wordpress.com%2Fi%2Fmu.gif&#38;r=PG" medium="image">
			<media:title type="html">soundripple</media:title>
		</media:content>
	</item>
		<item>
		<title>Life in a den of iniquity</title>
		<link>http://soundripple.com/2009/05/18/life-in-a-den-of-iniquity/</link>
		<comments>http://soundripple.com/2009/05/18/life-in-a-den-of-iniquity/#comments</comments>
		<pubDate>Mon, 18 May 2009 19:12:02 +0000</pubDate>
		<dc:creator>soundripple</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://soundripple.com/?p=71</guid>
		<description><![CDATA[A recent post here highlights &#8217;sinful&#8217; areas of the country, and of course Florida features as a reasonably sinful location &#8211; there&#8217;s a reason it&#8217;s a logical choice for shows from Miami Vice through to CSI: Miami!
I think an interesting comparison would be to update the sins list, replacing the more traditional items with things [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=soundripple.com&blog=6360666&post=71&subd=soundripple&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>A recent post <a href="http://scienceblogs.com/gnxp/2009/05/map_of_seven_deadly_sins.php">here</a> highlights &#8217;sinful&#8217; areas of the country, and of course Florida features as a reasonably sinful location &#8211; there&#8217;s a reason it&#8217;s a logical choice for shows from <em>Miami Vice</em> through to <em>CSI: Miami</em>!</p>
<p>I think an interesting comparison would be to update the sins list, replacing the more traditional items with things like human rights violations, environmental damage, non-sustainable living, animal cruelty, disparity of wealth, and so on &#8211; and map <em>those</em> figures out, on a world-wide basis.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/soundripple.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/soundripple.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/soundripple.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/soundripple.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/soundripple.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/soundripple.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/soundripple.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/soundripple.wordpress.com/71/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/soundripple.wordpress.com/71/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/soundripple.wordpress.com/71/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=soundripple.com&blog=6360666&post=71&subd=soundripple&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://soundripple.com/2009/05/18/life-in-a-den-of-iniquity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c556330076dacddeaa432d3cdadb6a0d?s=96&#38;d=http%3A%2F%2Fa.wordpress.com%2Fi%2Fmu.gif&#38;r=PG" medium="image">
			<media:title type="html">soundripple</media:title>
		</media:content>
	</item>
	</channel>
</rss>