<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Carpe Datum</title><subtitle type="html">Data Flotsam and Jetsam</subtitle><id>http://blogs.msdn.com/buckwoody/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/buckwoody/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/buckwoody/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2009-06-19T07:24:27Z</updated><entry><title>Read a Web Page from PowerShell, Make a Web Page from a Database Query From PowerShell</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/buckwoody/archive/2009/07/09/read-a-web-page-from-powershell-make-a-web-page-from-a-database-query-from-powershell.aspx" /><id>http://blogs.msdn.com/buckwoody/archive/2009/07/09/read-a-web-page-from-powershell-make-a-web-page-from-a-database-query-from-powershell.aspx</id><published>2009-07-09T15:46:45Z</published><updated>2009-07-09T15:46:45Z</updated><content type="html">&lt;p&gt;I presented at the Pacific Northwest SQL Server User Group here in the Seattle area last night, and I was asked at the break about reading a web page in PowerShell, and being able to do something with the data it has. There are actually a few ways to do that, but you should probably start with the &lt;em&gt;&lt;strong&gt;net.webclient&lt;/strong&gt;&lt;/em&gt; call - there's a quick overview of that here: &lt;a href="http://www.johndcook.com/PowerShellCookbook.html#a20"&gt;http://www.johndcook.com/PowerShellCookbook.html#a20&lt;/a&gt; and more info on it here: &lt;a href="http://msdn.microsoft.com/en-us/library/system.net.webclient(VS.80).aspx"&gt;http://msdn.microsoft.com/en-us/library/system.net.webclient(VS.80).aspx&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;Once you have the web page object, you'll need to parse it using string methods to find the data you want to get, store those as variables, and then use standard database insert calls to put the data back. Here's an article on inserting data, and there are others as well: &lt;a href="http://www.scriptinganswers.com/forum2/forum_posts.asp?TID=2316"&gt;http://www.scriptinganswers.com/forum2/forum_posts.asp?TID=2316&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;You can also hit a web service even easier, and then store the results directly into a variable: &lt;a href="http://thepowershellguy.com/blogs/posh/archive/2009/05/15/powershell-v2-get-weather-function-using-a-web-service.aspx"&gt;http://thepowershellguy.com/blogs/posh/archive/2009/05/15/powershell-v2-get-weather-function-using-a-web-service.aspx&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;And I've written an article that shows how to go the other way and make a simple web page by using PowerShell to extract data from a database. You can find that here: &lt;a href="http://www.informit.com/guides/content.aspx?g=sqlserver&amp;amp;seqNum=272"&gt;http://www.informit.com/guides/content.aspx?g=sqlserver&amp;amp;seqNum=272&lt;/a&gt;. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9826981" width="1" height="1"&gt;</content><author><name>Buck Woody - MSFT</name><uri>http://blogs.msdn.com/members/Buck+Woody+-+MSFT.aspx</uri></author><category term="Web" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Web/default.aspx" /><category term="SQL Server" scheme="http://blogs.msdn.com/buckwoody/archive/tags/SQL+Server/default.aspx" /><category term="PowerShell" scheme="http://blogs.msdn.com/buckwoody/archive/tags/PowerShell/default.aspx" /></entry><entry><title>ODBC Drivers Are Updated in Windows 7</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/buckwoody/archive/2009/07/08/odbc-drivers-are-updated-in-windows-7.aspx" /><id>http://blogs.msdn.com/buckwoody/archive/2009/07/08/odbc-drivers-are-updated-in-windows-7.aspx</id><published>2009-07-08T15:14:29Z</published><updated>2009-07-08T15:14:29Z</updated><content type="html">&lt;p&gt;One of the first exposures I had to an ODBC driver was NOT a good one - the particular behavior for ANSI NULLS ended up causing some issues in a database application that I had inherited, so I tend to keep my eye on these things. Mind you, it was back in the SQL Server 6.5 days, and I haven't had an issue since then, but I keep an eye on it nonetheless. &lt;/p&gt;  &lt;p&gt;Windows 7, which is set to release soon, includes a new ODBC driver - 3.80. &lt;a href="http://blogs.msdn.com/data/archive/2009/07/06/odbc-dm-3-80-in-windows-7-and-windows-server-2008-r2.aspx" target="_blank"&gt;It gives you several new enhancements which you can read about here&lt;/a&gt;, but keep this in mind when you're deploying a new operating system - this is exactly the situation that bit me. The point is, as always, whenever you make a change, test, test, test.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9824121" width="1" height="1"&gt;</content><author><name>Buck Woody - MSFT</name><uri>http://blogs.msdn.com/members/Buck+Woody+-+MSFT.aspx</uri></author><category term="SQL Server Downloads" scheme="http://blogs.msdn.com/buckwoody/archive/tags/SQL+Server+Downloads/default.aspx" /><category term="Web" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Web/default.aspx" /><category term="Developer" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Developer/default.aspx" /><category term="DBA" scheme="http://blogs.msdn.com/buckwoody/archive/tags/DBA/default.aspx" /><category term="SQL Server" scheme="http://blogs.msdn.com/buckwoody/archive/tags/SQL+Server/default.aspx" /><category term="Latest Version" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Latest+Version/default.aspx" /><category term="Upgrades" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Upgrades/default.aspx" /></entry><entry><title>SQL Server 2008 Books Online Update is Released</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/buckwoody/archive/2009/07/07/sql-server-2008-books-online-update-is-released.aspx" /><id>http://blogs.msdn.com/buckwoody/archive/2009/07/07/sql-server-2008-books-online-update-is-released.aspx</id><published>2009-07-07T15:12:04Z</published><updated>2009-07-07T15:12:04Z</updated><content type="html">&lt;p&gt;I try not to post things that others have already discussed, but I make a few exceptions. I'll (re)tell you about security issues and service packs, and I'll also mention when Books Online is updated. I run into so many issues that are already covered in BOL, so I think it's important to track when new content is added or altered. &lt;/p&gt;  &lt;p&gt;You can find the On-Line version (which is always the latest) here: &lt;a href="http://msdn.microsoft.com/en-us/library/ms130214.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms130214.aspx&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;You can find what has changed for this version here: &lt;a href="http://msdn.microsoft.com/en-us/library/dd776386.aspx"&gt;http://msdn.microsoft.com/en-us/library/dd776386.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;You'll get the latest version in your Microsoft Update Services for the installed BOL. How can you tell what version of BOL you have installed? Look in the title bar. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9822738" width="1" height="1"&gt;</content><author><name>Buck Woody - MSFT</name><uri>http://blogs.msdn.com/members/Buck+Woody+-+MSFT.aspx</uri></author><category term="Documentation" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Documentation/default.aspx" /><category term="Developer" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Developer/default.aspx" /><category term="DBA" scheme="http://blogs.msdn.com/buckwoody/archive/tags/DBA/default.aspx" /><category term="SQL Server" scheme="http://blogs.msdn.com/buckwoody/archive/tags/SQL+Server/default.aspx" /><category term="SQL Server 2008" scheme="http://blogs.msdn.com/buckwoody/archive/tags/SQL+Server+2008/default.aspx" /></entry><entry><title>Consolidation Strategies: Profiling Your Systems</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/buckwoody/archive/2009/07/06/consolidation-strategies-profiling-your-systems.aspx" /><id>http://blogs.msdn.com/buckwoody/archive/2009/07/06/consolidation-strategies-profiling-your-systems.aspx</id><published>2009-07-06T15:00:37Z</published><updated>2009-07-06T15:00:37Z</updated><content type="html">&lt;p&gt;Many shops are considering consolidating their SQL Server Instances onto fewer boxes, as I've blogged about before. There are lots of ways to think about consolidation, from placing more databases on one Instance (Database Stacking), putting multiple Instances on one server (Instance Stacking), and using a Hypervisor (Virtualization). But before you do any of that, you should profile the servers and Instances you currently have so that you know what applications are candidates for consolidation.&lt;/p&gt;  &lt;p&gt;So how do you do that? Well, you could learn lots of counters, objects, dynamic management views and so on, or you could just download the latest Microsoft Assessment and Planning Tool and run that. &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=67240b76-3148-4e49-943d-4d9ea7f77730&amp;amp;DisplayLang=en" target="_blank"&gt;Here's the link for that&lt;/a&gt;, and &lt;a href="http://www.informit.com/guides/content.aspx?g=sqlserver&amp;amp;seqNum=306" target="_blank"&gt;here's an article I did for the product&lt;/a&gt;. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9819929" width="1" height="1"&gt;</content><author><name>Buck Woody - MSFT</name><uri>http://blogs.msdn.com/members/Buck+Woody+-+MSFT.aspx</uri></author><category term="Downloads" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Downloads/default.aspx" /><category term="Web" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Web/default.aspx" /><category term="DBA" scheme="http://blogs.msdn.com/buckwoody/archive/tags/DBA/default.aspx" /><category term="SQL Server" scheme="http://blogs.msdn.com/buckwoody/archive/tags/SQL+Server/default.aspx" /><category term="Administration" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Administration/default.aspx" /><category term="Planning" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Planning/default.aspx" /><category term="Virtualization" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Virtualization/default.aspx" /></entry><entry><title>Quote of the Day: On Keeping Ease in its Place</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/buckwoody/archive/2009/07/03/quote-of-the-day-on-keeping-ease-in-its-place.aspx" /><id>http://blogs.msdn.com/buckwoody/archive/2009/07/03/quote-of-the-day-on-keeping-ease-in-its-place.aspx</id><published>2009-07-03T15:07:13Z</published><updated>2009-07-03T15:07:13Z</updated><content type="html">&lt;p&gt;I admire people who have overcome difficulties to achieve. I find so few people today that can stand any adversity - people whine and complain at the slightest inconvenience. In the past character seemed to matter more, and Helen Keller was one such person of character. She said:&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;quot;Character cannot be developed in ease and quiet. Only through experiences of trial and suffering can the soul be strengthened, vision cleared, ambition inspired and success achieved.&amp;quot;&amp;#160; - Helen Keller&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9816831" width="1" height="1"&gt;</content><author><name>Buck Woody - MSFT</name><uri>http://blogs.msdn.com/members/Buck+Woody+-+MSFT.aspx</uri></author><category term="Quote Of The Day" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Quote+Of+The+Day/default.aspx" /></entry><entry><title>PowerShell and SQL Server: Script all Tables</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/buckwoody/archive/2009/07/02/powershell-and-sql-server-script-all-tables.aspx" /><id>http://blogs.msdn.com/buckwoody/archive/2009/07/02/powershell-and-sql-server-script-all-tables.aspx</id><published>2009-07-02T14:27:52Z</published><updated>2009-07-02T14:27:52Z</updated><content type="html">&lt;p&gt;This is a script that I found/put together/re-arranged that will script out all of the tables from a database - in this case, Adventureworks2008. You need to change the BWOODY1 part to the name of your server, and the SQL2K8 part to your Instance name. You can change the database name as well, of course, and a better method would be to make a function out of this and feed those variables in. &lt;/p&gt;  &lt;p&gt;There are other ways to do this, but this script illustrates setting some of the scripting options. You can look up the SMO model for all of them.&lt;/p&gt;  &lt;p&gt;As always, test this script out thoroughly, and understand what you're doing before you put this on a production system. Also, don't run with scissors, and don't open attachments from people you do not know:&lt;/p&gt;  &lt;div&gt;   &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;     &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;# Script all tables in the AdventureWorks2008 database&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;[System.Reflection.Assembly]::LoadWithPartialName(&lt;span style="color: #006080"&gt;&amp;quot;Microsoft.SqlServer.SMO&amp;quot;&lt;/span&gt;) | out-null&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;$s = new-object (&lt;span style="color: #006080"&gt;'Microsoft.SqlServer.Management.Smo.Server'&lt;/span&gt;) &lt;span style="color: #006080"&gt;'BWOODY1\SQL2K8'&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;$db = $s.Databases[&lt;span style="color: #006080"&gt;'AdventureWorks2008'&lt;/span&gt;]&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;$scrp = new-object (&lt;span style="color: #006080"&gt;'Microsoft.SqlServer.Management.Smo.Scripter'&lt;/span&gt;) ($s)&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;$scrp.Options.AppendToFile = $True&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;$scrp.Options.ClusteredIndexes = $True&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;$scrp.Options.DriAll = $True&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;$scrp.Options.ScriptDrops = $False&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;$scrp.Options.IncludeHeaders = $True&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;$scrp.Options.ToFileOnly = $True&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;$scrp.Options.Indexes = $True&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;$scrp.Options.WithDependencies = $True&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;$scrp.Options.FileName = &lt;span style="color: #006080"&gt;'C:\TEMP\AdventureWorks2008Tables.SQL'&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;$scrp.Script($db.Tables)&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9814199" width="1" height="1"&gt;</content><author><name>Buck Woody - MSFT</name><uri>http://blogs.msdn.com/members/Buck+Woody+-+MSFT.aspx</uri></author><category term="Scripts" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Scripts/default.aspx" /><category term="SQL Server" scheme="http://blogs.msdn.com/buckwoody/archive/tags/SQL+Server/default.aspx" /><category term="PowerShell" scheme="http://blogs.msdn.com/buckwoody/archive/tags/PowerShell/default.aspx" /></entry><entry><title>SQL Server Best Practices: Auto-Shrink Should Be Off</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/buckwoody/archive/2009/07/01/sql-server-best-practices-auto-shrink-should-be-off.aspx" /><id>http://blogs.msdn.com/buckwoody/archive/2009/07/01/sql-server-best-practices-auto-shrink-should-be-off.aspx</id><published>2009-07-01T14:08:46Z</published><updated>2009-07-01T14:08:46Z</updated><content type="html">&lt;p&gt;SQL Server is one of the easiest databases to maintain because of all of the automatic settings it has, but as I mentioned with Auto-Close, some of them should be left off. The Auto-Shrink setting is another.&lt;/p&gt;  &lt;p&gt;That might surprise a few people. You might think from the name of this operation, that you would want your databases to automatically reclaim any space they take whenever they can. And if SQL Server will handle that for you, all the more wonderful. But in fact, shrinking a database can cause your Indexes to be fragmented, especially if it happens a lot. I never shrink my databases unless I have a huge deletion of data, and I know that the data won't come back. That's a pretty rare event, and when it does happen I run the shrink operation manually and rebuild my indexes after.&lt;/p&gt;  &lt;p&gt;My friend Paul Randall has a great explanation of why this happens, and another way to reclaim that space without running shrink at all: &lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Why-you-should-not-shrink-your-data-files.aspx"&gt;http://www.sqlskills.com/BLOGS/PAUL/post/Why-you-should-not-shrink-your-data-files.aspx&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9811105" width="1" height="1"&gt;</content><author><name>Buck Woody - MSFT</name><uri>http://blogs.msdn.com/members/Buck+Woody+-+MSFT.aspx</uri></author><category term="SQL Server" scheme="http://blogs.msdn.com/buckwoody/archive/tags/SQL+Server/default.aspx" /><category term="Microsoft" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Microsoft/default.aspx" /><category term="Best Practices" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Best+Practices/default.aspx" /></entry><entry><title>What's a Microsoft "Fast Track" for Data Warehousing?</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/buckwoody/archive/2009/06/30/what-s-a-microsoft-fast-track-for-data-warehousing.aspx" /><id>http://blogs.msdn.com/buckwoody/archive/2009/06/30/what-s-a-microsoft-fast-track-for-data-warehousing.aspx</id><published>2009-06-30T16:10:31Z</published><updated>2009-06-30T16:10:31Z</updated><content type="html">&lt;p&gt;Microsoft is a platform company, meaning that we don't often sell pre-packaged solutions, but rather tools for you to make them. In other words, we sell Microsoft Word, we don't type the letters for you.&lt;/p&gt;  &lt;p&gt;But in some cases you might like to have a little more guidance than just &amp;quot;Here's a database product. Go nuts.&amp;quot; You might want to know what OS goes with which edition, and you might even want to know what hardware configuration to buy. &lt;/p&gt;  &lt;p&gt;To help you with that, we came out with this concept of a &amp;quot;Fast Track&amp;quot;. It's basically a manifest of hardware and software to buy and a list of how to set it all up, that ends up with a solution you can use for Data Warehousing. I really like the idea, and I hope we extend it to the database platform, although I've not heard anything to that effect. At any rate, you can check it out here: &lt;a href="http://www.microsoft.com/sqlserver/2008/en/us/fasttrack.aspx"&gt;http://www.microsoft.com/sqlserver/2008/en/us/fasttrack.aspx&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9809775" width="1" height="1"&gt;</content><author><name>Buck Woody - MSFT</name><uri>http://blogs.msdn.com/members/Buck+Woody+-+MSFT.aspx</uri></author><category term="Web" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Web/default.aspx" /><category term="SQL Server" scheme="http://blogs.msdn.com/buckwoody/archive/tags/SQL+Server/default.aspx" /><category term="Microsoft" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Microsoft/default.aspx" /><category term="Business Intelligence" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Business+Intelligence/default.aspx" /></entry><entry><title>Grid Painting and Database Projects</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/buckwoody/archive/2009/06/29/grid-painting-and-database-projects.aspx" /><id>http://blogs.msdn.com/buckwoody/archive/2009/06/29/grid-painting-and-database-projects.aspx</id><published>2009-06-29T15:08:27Z</published><updated>2009-06-29T15:08:27Z</updated><content type="html">&lt;p&gt;I'm not very good at drawing. My drawings of people and objects with depth usually looks like what your 5th grader does, but not the talented 5th grader. But I found a trick that helps me draw not only depth, but complex things as well.&lt;/p&gt;  &lt;p&gt;It involves taking a picture you want to duplicate and laying out a grid of lines over it. Then you just draw the same grid on another sheet of paper, and instead of trying to draw the entire person, landscape or horse, you focus on one little box in the original grid and draw the squiggly lines you see there. Then move one box to the right and do that again, and again, and again, and eventually you've drawn the entire scene. Carefully erase the grid lines that are left, and you've drawn better than you really can by freehand!&lt;/p&gt;  &lt;p&gt;I've been asked by some DBA's how to approach a complex project, and I think the trick is to do the same thing. I lay out an imaginary &amp;quot;grid&amp;quot; or work to do. The first grid I lay out is really large:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Design the database solution&lt;/li&gt;    &lt;li&gt;Implement the solution &lt;/li&gt;    &lt;li&gt;Set up maintenance (both database and code-related) for the solution&lt;/li&gt;    &lt;li&gt;Set up High Availability (HA), Disaster Recovery (DR), and Security for the solution&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Then I set up a finer &amp;quot;grid&amp;quot; on each of these - Design breaks down into:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Define the business requirements&lt;/li&gt;    &lt;li&gt;Look for nouns and verbs&lt;/li&gt;    &lt;li&gt;Turn those into tables and relationships&lt;/li&gt;    &lt;li&gt;Tease out the columns for the tables &lt;/li&gt;    &lt;li&gt;Normalize the tables&lt;/li&gt;    &lt;li&gt;Set up the Referential Integrity...&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;And so on. I do the same for each of the main &amp;quot;grid&amp;quot; segments, and then off I go. Sure, this is just turning big problems into smaller ones, but I find that it really helps - it removes the stress, focuses the attention and allows me to create a fairly accurate timeline for my part of the project.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9808661" width="1" height="1"&gt;</content><author><name>Buck Woody - MSFT</name><uri>http://blogs.msdn.com/members/Buck+Woody+-+MSFT.aspx</uri></author><category term="Developer" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Developer/default.aspx" /><category term="DBA" scheme="http://blogs.msdn.com/buckwoody/archive/tags/DBA/default.aspx" /><category term="Development" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Development/default.aspx" /><category term="SQL Server" scheme="http://blogs.msdn.com/buckwoody/archive/tags/SQL+Server/default.aspx" /><category term="Design" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Design/default.aspx" /><category term="Planning" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Planning/default.aspx" /></entry><entry><title>Quote of the Day: Aesop On Learning</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/buckwoody/archive/2009/06/26/quote-of-the-day-aesop-on-learning.aspx" /><id>http://blogs.msdn.com/buckwoody/archive/2009/06/26/quote-of-the-day-aesop-on-learning.aspx</id><published>2009-06-26T15:21:46Z</published><updated>2009-06-26T15:21:46Z</updated><content type="html">&lt;p&gt;It is truly remarkable how many things we learn from the ancients - and how much we don't: &lt;/p&gt;  &lt;p&gt;&amp;quot;Good judgment comes from experience, and experience--well that comes from poor judgment.&amp;quot; - Aesop&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9805589" width="1" height="1"&gt;</content><author><name>Buck Woody - MSFT</name><uri>http://blogs.msdn.com/members/Buck+Woody+-+MSFT.aspx</uri></author><category term="Quote Of The Day" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Quote+Of+The+Day/default.aspx" /></entry><entry><title>Use PowerShell to Backup All User Databases</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/buckwoody/archive/2009/06/25/use-powershell-to-backup-all-user-databases.aspx" /><id>http://blogs.msdn.com/buckwoody/archive/2009/06/25/use-powershell-to-backup-all-user-databases.aspx</id><published>2009-06-25T15:16:46Z</published><updated>2009-06-25T15:16:46Z</updated><content type="html">&lt;p&gt;This script will back up all user databases - you need to change the BWOODY1\SQL2K8 part to your server\instance name, and of course, you should only run this on a test system until you completely understand it.&lt;/p&gt;  &lt;p&gt;Unfortunately, the SQL Server PowerShell Provider doesn't make this very easy - and there may be a better way to do this once I research it more.&lt;/p&gt;  &lt;p&gt;Also - this script was adapted from one given to me earlier, and unfortunately I don't recall the source. If this is partly your work, please add a comment here for attribution:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div&gt;   &lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;     &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #008000"&gt;# Performs a Full backup followed by a transaction log backup on all user databases&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;[System.Reflection.Assembly]::LoadWithPartialName(&lt;span style="color: #006080"&gt;&amp;quot;Microsoft.SqlServer.SMO&amp;quot;&lt;/span&gt;)  | out-null&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;$s = new-object (&lt;span style="color: #006080"&gt;'Microsoft.SqlServer.Management.Smo.Server'&lt;/span&gt;) &lt;span style="color: #006080"&gt;'BWOODY1\SQL2K8'&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;$bkdir = $s.Settings.BackupDirectory&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;$dbs = $s.Databases&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;$dbs | &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt;-object {&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    $db = $_&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; ($db.IsSystemObject &lt;span style="color: #cc6633"&gt;-eq&lt;/span&gt; $False -and $db.IsMirroringEnabled &lt;span style="color: #cc6633"&gt;-eq&lt;/span&gt; $False) {&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        $dbname = $db.Name&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        $dt = get-date -format yyyyMMddHHmmss&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        $dbbk = new-object (&lt;span style="color: #006080"&gt;'Microsoft.SqlServer.Management.Smo.Backup'&lt;/span&gt;)&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        $dbbk.Action = &lt;span style="color: #006080"&gt;'Database'&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        $dbbk.BackupSetDescription = &lt;span style="color: #006080"&gt;&amp;quot;Full backup of &amp;quot;&lt;/span&gt; + $dbname&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        $dbbk.BackupSetName = $dbname + &lt;span style="color: #006080"&gt;&amp;quot; Backup&amp;quot;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        $dbbk.Database = $dbname&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        $dbbk.MediaDescription = &lt;span style="color: #006080"&gt;&amp;quot;Disk&amp;quot;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        $dbbk.Devices.AddDevice($bkdir + &lt;span style="color: #006080"&gt;&amp;quot;\&amp;quot; + $dbname + &amp;quot;&lt;/span&gt;_db_&lt;span style="color: #006080"&gt;&amp;quot; + $dt + &amp;quot;&lt;/span&gt;.bak&lt;span style="color: #006080"&gt;&amp;quot;, 'File')&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        $dbbk.SqlBackup($s)&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        if ($db.DatabaseOptions.RecoveryModel -ne 'Simple') {&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            $dt = get-date -format yyyyMMddHHmmss&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            $dbtrn = new-object ('Microsoft.SqlServer.Management.Smo.Backup')&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            $dbtrn.Action = 'Log'&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            $dbtrn.BackupSetDescription = &amp;quot;&lt;/span&gt;Trans Log backup of &lt;span style="color: #006080"&gt;&amp;quot; + $dbname&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            $dbtrn.BackupSetName = $dbname + &amp;quot;&lt;/span&gt; Backup&lt;span style="color: #006080"&gt;&amp;quot;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            $dbtrn.Database = $dbname&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            $dbtrn.MediaDescription = &amp;quot;&lt;/span&gt;Disk&lt;span style="color: #006080"&gt;&amp;quot;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            $dbtrn.Devices.AddDevice($bkdir + &amp;quot;&lt;/span&gt;\&lt;span style="color: #006080"&gt;&amp;quot; + $dbname + &amp;quot;&lt;/span&gt;_tlog_&lt;span style="color: #006080"&gt;&amp;quot; + $dt + &amp;quot;&lt;/span&gt;.trn&amp;quot;, &lt;span style="color: #006080"&gt;'File'&lt;/span&gt;)&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            $dbtrn.SqlBackup($s)&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            }&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        }&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9803705" width="1" height="1"&gt;</content><author><name>Buck Woody - MSFT</name><uri>http://blogs.msdn.com/members/Buck+Woody+-+MSFT.aspx</uri></author><category term="DBA" scheme="http://blogs.msdn.com/buckwoody/archive/tags/DBA/default.aspx" /><category term="Scripts" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Scripts/default.aspx" /><category term="SQL Server" scheme="http://blogs.msdn.com/buckwoody/archive/tags/SQL+Server/default.aspx" /><category term="PowerShell" scheme="http://blogs.msdn.com/buckwoody/archive/tags/PowerShell/default.aspx" /><category term="Tips" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Tips/default.aspx" /></entry><entry><title>SQL Server Best Practices: AutoClose Should be Off</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/buckwoody/archive/2009/06/24/sql-server-best-practices-autoclose-should-be-off.aspx" /><id>http://blogs.msdn.com/buckwoody/archive/2009/06/24/sql-server-best-practices-autoclose-should-be-off.aspx</id><published>2009-06-24T15:50:21Z</published><updated>2009-06-24T15:50:21Z</updated><content type="html">&lt;p&gt;When SQL Server &amp;quot;opens&amp;quot; a database, resources are assigned to maintaining that state. Memory for locks, buffers, security tokens and so on is assigned, and there is associated CPU and even a little I/O. When connections are made to the database, these resources are ready and waiting. The &lt;strong&gt;AutoClose&lt;/strong&gt; setting dictates how these resources are handled. If this setting is ON, then when the last user connection that disconnects, SQL Server releases all of those resources back to the server. That might sound like a good thing, but if you think about the pattern of connections, the &amp;quot;last&amp;quot; connection doesn't mean that someone might not connect one tenth of a second later. In that case, SQL Server would shut all of the resources down, and then have to spin them right back up again. As a result, the server makes the connection wait, which makes the system seem slower.&lt;/p&gt;  &lt;p&gt;So the best practice is to leave this setting OFF. In fact, SQL Server 2008 Books Online states that this setting is going away anyway, so you should have them turned off (&lt;a href="http://msdn.microsoft.com/en-us/library/ms135094(SQL.90).aspx"&gt;http://msdn.microsoft.com/en-us/library/ms135094(SQL.90).aspx&lt;/a&gt;). &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9801660" width="1" height="1"&gt;</content><author><name>Buck Woody - MSFT</name><uri>http://blogs.msdn.com/members/Buck+Woody+-+MSFT.aspx</uri></author><category term="SQL Server" scheme="http://blogs.msdn.com/buckwoody/archive/tags/SQL+Server/default.aspx" /><category term="Microsoft" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Microsoft/default.aspx" /><category term="Best Practices" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Best+Practices/default.aspx" /></entry><entry><title>Is Your Infrastructure Crumbling?</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/buckwoody/archive/2009/06/23/is-your-infrastructure-crumbling.aspx" /><id>http://blogs.msdn.com/buckwoody/archive/2009/06/23/is-your-infrastructure-crumbling.aspx</id><published>2009-06-23T14:20:56Z</published><updated>2009-06-23T14:20:56Z</updated><content type="html">&lt;p&gt;I watched a documentary (of sorts) last night called &amp;quot;Crumbling America&amp;quot; that talked about America's infrastructure issues. They detailed how roads, bridges, electrical grids and water systems are having serious issues and are basically falling apart. I think they were sensationalizing a bit, but it was interesting to note that America spends only 4% of it's income on infrastructure now, down from a high over over three times that amount. Even the &amp;quot;stimulus&amp;quot; plan containing almost a trillion dollars has less than 9% of the money earmarked for infrastructure. &lt;/p&gt;  &lt;p&gt;I found all this interesting because it has corollaries to our IT infrastructure. While I can't control our federal infrastructure, but I can affect my local IT infrastructure, especially the database. I pulled out three things from the television program that I thought was applicable to IT. They mentioned three main issues with infrastructure that I think we should evaluate in our own systems:&lt;/p&gt;  &lt;p&gt;1. The system had a design flaw.&lt;/p&gt;  &lt;p&gt;The first thing that they pointed out about a road or bridge that failed was that in some cases the engineers decided to go with a lighter steel plate, or a different kind of surface that turned out not to be strong enough or last long enough. This holds true in IT as well. I've seen many systems that just had a fundamental design flaw that caused an issue later. What can we do about this? Two things: educate yourself about good design patterns and implement them in your own code, and evaluate any &amp;quot;canned&amp;quot; solutions your company buys and ask the hard questions about the design of the software. After all, you have to live with it when it is gone.&lt;/p&gt;  &lt;p&gt;2. The system can't handle the load or speeds required in a modern environment.&lt;/p&gt;  &lt;p&gt;In the case of a water system or electrical grid, the initial design or even the overall arrangement of the components cannot handle how much work required from the users. This of course has obvious parallels to IT. The thing we can do as DBA's and Developers is to do a good job of projecting load, and constantly monitoring the systems to make sure we know when we're reaching a limit.&lt;/p&gt;  &lt;p&gt;3. The system upgrades keep getting deferred.&lt;/p&gt;  &lt;p&gt;Keeping a road, bridge or other system maintained and upgraded is very expensive and disruptive. Politicians take the easy way out and defer that maintenance over and over. This leads to eventual disaster. It's the same in IT. As you monitor your systems, make sure you push for upgrades along the way. I run into firms every day that are still using SQL Server 2000 - even though it is out of maintenance, has lower security, and does not perform as well as the newer versions. I'm told &amp;quot;my vendor won't upgrade&amp;quot; or &amp;quot;it's working just fine&amp;quot; and it reminds me of the inspectors on the bridges that fail.&lt;/p&gt;  &lt;p&gt;There are more parallels, but I think you have the idea. You can take almost any system that handles &amp;quot;traffic&amp;quot; or load and learn from it. The question is, will you?&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9799512" width="1" height="1"&gt;</content><author><name>Buck Woody - MSFT</name><uri>http://blogs.msdn.com/members/Buck+Woody+-+MSFT.aspx</uri></author><category term="Developer" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Developer/default.aspx" /><category term="DBA" scheme="http://blogs.msdn.com/buckwoody/archive/tags/DBA/default.aspx" /><category term="SQL Server" scheme="http://blogs.msdn.com/buckwoody/archive/tags/SQL+Server/default.aspx" /><category term="Microsoft" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Microsoft/default.aspx" /><category term="Disaster Recovery" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Disaster+Recovery/default.aspx" /></entry><entry><title>Help Me Help You</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/buckwoody/archive/2009/06/22/help-me-help-you.aspx" /><id>http://blogs.msdn.com/buckwoody/archive/2009/06/22/help-me-help-you.aspx</id><published>2009-06-22T14:53:31Z</published><updated>2009-06-22T14:53:31Z</updated><content type="html">&lt;p&gt;&lt;em&gt;Before I start this post, let me say that it is not pointed at any one person - if you've asked me for help recently, this isn't about you!&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;The programming and administration computer disciplines are fairly unique, in my mind, in one interesting way: we help each other a lot. Since the beginning of the DARPANET, which eventually became the Internet, administrators have used e-mail, newsgroups and other methods to chat with each other - &lt;font color="#0000ff"&gt;&amp;quot;hey, I'm having this issue....anyone know how to handle that?&amp;quot;&lt;/font&gt; It was a form of necessity, since everyone had to come up to speed quickly on a technology that wasn't documented yet because it didn't exist yet.&lt;/p&gt;  &lt;p&gt;And that tradition continues today. Those of us that work at Microsoft, and of course tons of people who don't, participate in forums, e-mail exchanges, newsgroups and other forms of user-to-user assistance. But many times I'm not able (or very willing, at least) to help someone because they get in their own way. So I thought I would create a blog entry that gives you some ways to get help from those willing to give it. If you'll follow these simple steps, you'll probably find more of your posts answered:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;1. State your question clearly.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Instead of &lt;font color="#0000ff"&gt;&amp;quot;I tried this terrible software and it doesn't work right - how do I fix that?&amp;quot;&lt;/font&gt; be very specific: &lt;font color="#0000ff"&gt;&amp;quot;When I implement the Maintenance Plan Wizard, on step three of the Wizard I get error 980234 from SQL Server Management Studio. Has anyone else encountered that, and where should I look to start fixing this?&amp;quot;&lt;/font&gt; The more precise you are the better the odds that someone can help you.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;2. State what you've done to fix the problem so far.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Explain all of the steps you've taken to research or correct the issue so far: &lt;font color="#0000ff"&gt;&amp;quot;...so I looked up error 980234 in Books Online, but it doesn't seem to apply because I'm not on a cluster. I searched on &amp;quot;non-clustered&amp;quot; and &amp;quot;980234&amp;quot; and I didn't come up with any hits.&amp;quot;&lt;/font&gt; If you haven't even read the manual or looked at any one of the thousands of pages of documentation on the subject, don't ask the question. Do your homework first, put some effort into finding the answer. &lt;/p&gt;  &lt;p&gt;On this note, don't expect others to re-write your code or do your work for you. There's a very big line between helping you find the answer to a question and doing your job - that's why they pay you, not me. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;3. Be professional.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;No one cares how much you hate a vendor or software product. No one cares how much time you've spent on this or how frustrated you are. None of that matters - what matters is that you need your problem fixed. If you ask a vague question, and insult Microsoft (or any vendor, actually), I just move on to another question. And don't demand and answer: &lt;font color="#0000ff"&gt;&amp;quot;I need someone to help me fix this now!&amp;quot; &lt;/font&gt;If you can't be nice, why should someone else?&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9797736" width="1" height="1"&gt;</content><author><name>Buck Woody - MSFT</name><uri>http://blogs.msdn.com/members/Buck+Woody+-+MSFT.aspx</uri></author><category term="Searching" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Searching/default.aspx" /><category term="Documentation" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Documentation/default.aspx" /><category term="Web" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Web/default.aspx" /><category term="Help" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Help/default.aspx" /><category term="Developer" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Developer/default.aspx" /><category term="DBA" scheme="http://blogs.msdn.com/buckwoody/archive/tags/DBA/default.aspx" /><category term="SQL Server" scheme="http://blogs.msdn.com/buckwoody/archive/tags/SQL+Server/default.aspx" /><category term="Administration" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Administration/default.aspx" /><category term="Microsoft" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Microsoft/default.aspx" /><category term="Questions" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Questions/default.aspx" /></entry><entry><title>Quote of the Day: On Taking Chances</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/buckwoody/archive/2009/06/19/quote-of-the-day-on-taking-chances.aspx" /><id>http://blogs.msdn.com/buckwoody/archive/2009/06/19/quote-of-the-day-on-taking-chances.aspx</id><published>2009-06-19T14:24:27Z</published><updated>2009-06-19T14:24:27Z</updated><content type="html">&lt;p&gt;Sometimes when things are tight people take fewer chances - but I think that's the very time you should go after the big things: &lt;/p&gt;  &lt;p&gt;&amp;quot;Why not go out on a limb? Isn't that where the fruit is?&amp;quot; - Frank Scully&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9788031" width="1" height="1"&gt;</content><author><name>Buck Woody - MSFT</name><uri>http://blogs.msdn.com/members/Buck+Woody+-+MSFT.aspx</uri></author><category term="Quote Of The Day" scheme="http://blogs.msdn.com/buckwoody/archive/tags/Quote+Of+The+Day/default.aspx" /></entry></feed>