<?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/"
	>

<channel>
	<title>SQL Server Planet &#187; Scripts</title>
	<atom:link href="http://sqlserverplanet.com/category/scripts/feed" rel="self" type="application/rss+xml" />
	<link>http://sqlserverplanet.com</link>
	<description>Tips and Articles on SQL Server</description>
	<lastBuildDate>Tue, 31 Jan 2012 01:33:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Find Column in All Databases</title>
		<link>http://sqlserverplanet.com/scripts/find-column-in-all-databases</link>
		<comments>http://sqlserverplanet.com/scripts/find-column-in-all-databases#comments</comments>
		<pubDate>Fri, 30 Apr 2010 05:38:12 +0000</pubDate>
		<dc:creator>Derek Dieter</dc:creator>
				<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://sqlserverplanet.com/?p=1334</guid>
		<description><![CDATA[Occasionally, there comes a requirement to search all databases on a particular server for either columns with a specific name, or columns relating to a specific subject. In the most recent case, I had to find all similar columns in all databases because the company plans to change the datatype of these columns. My task [...]]]></description>
		<wfw:commentRss>http://sqlserverplanet.com/scripts/find-column-in-all-databases/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Is Job Running?</title>
		<link>http://sqlserverplanet.com/scripts/is-job-running</link>
		<comments>http://sqlserverplanet.com/scripts/is-job-running#comments</comments>
		<pubDate>Sat, 13 Mar 2010 23:53:48 +0000</pubDate>
		<dc:creator>Derek Dieter</dc:creator>
				<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://sqlserverplanet.com/?p=1213</guid>
		<description><![CDATA[The following SQL Server script works to determine if a particular job is currently running. This feature is nice to have if you do not want jobs to step over one another. I frequently will use this script as the first step of the job. If it is currently running, then the step will raise [...]]]></description>
		<wfw:commentRss>http://sqlserverplanet.com/scripts/is-job-running/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kill All Connections on a Database</title>
		<link>http://sqlserverplanet.com/scripts/kill-all-connections</link>
		<comments>http://sqlserverplanet.com/scripts/kill-all-connections#comments</comments>
		<pubDate>Tue, 06 Oct 2009 14:04:39 +0000</pubDate>
		<dc:creator>Derek Dieter</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[kill]]></category>

		<guid isPermaLink="false">http://sqlserverplanet.com/?p=908</guid>
		<description><![CDATA[This seems to be the easiest way to kill all connections (sessions) on a SQL Server database: ALTER DATABASE database_name SET SINGLE_USER WITH ROLLBACK IMMEDIATE After executing the above, it will put the database in single user mode. So you then need to remove single user mode using: EXEC sp_dboption 'database_name', 'single user', 'FALSE' Related [...]]]></description>
		<wfw:commentRss>http://sqlserverplanet.com/scripts/kill-all-connections/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rebuild and Reorganize Fragmented Indexes</title>
		<link>http://sqlserverplanet.com/scripts/rebuild-and-reorganize-fragmented-indexes</link>
		<comments>http://sqlserverplanet.com/scripts/rebuild-and-reorganize-fragmented-indexes#comments</comments>
		<pubDate>Sun, 21 Jun 2009 01:05:43 +0000</pubDate>
		<dc:creator>Derek Dieter</dc:creator>
				<category><![CDATA[Indexing]]></category>
		<category><![CDATA[Maintenance]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[index]]></category>

		<guid isPermaLink="false">http://sqlserverplanet.com/?p=329</guid>
		<description><![CDATA[This script will automatically determine whether a rebuild or a reorganize should be used according to the fragmentation of the index. It will then execute the appropriate command. Note that performing index rebuilds online during production hours will cause contention. SET NOCOUNT ON; DECLARE @objectid int; DECLARE @indexid int; DECLARE @partitioncount bigint; DECLARE @schemaname nvarchar(258); [...]]]></description>
		<wfw:commentRss>http://sqlserverplanet.com/scripts/rebuild-and-reorganize-fragmented-indexes/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to Update Statistics</title>
		<link>http://sqlserverplanet.com/scripts/update-statistics</link>
		<comments>http://sqlserverplanet.com/scripts/update-statistics#comments</comments>
		<pubDate>Sun, 21 Jun 2009 00:20:31 +0000</pubDate>
		<dc:creator>Derek Dieter</dc:creator>
				<category><![CDATA[Maintenance]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[update statistics]]></category>

		<guid isPermaLink="false">http://sqlserverplanet.com/?p=316</guid>
		<description><![CDATA[There are two ways to update statistics. The first way is the easy way. It is one line of code that will update all the statistics in the database using the default sample size of 20,000 rows per table. EXEC sp_updatestats The other way, is to use the UPDATE STATISTICS command. This command gives much [...]]]></description>
		<wfw:commentRss>http://sqlserverplanet.com/scripts/update-statistics/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

