<?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>MemoSoup &#187; MS SQL</title>
	<atom:link href="http://www.memosoup.com/category/sql-scripts/mssql/feed" rel="self" type="application/rss+xml" />
	<link>http://www.memosoup.com</link>
	<description>Mix of the things I always forget</description>
	<lastBuildDate>Fri, 30 Jul 2010 15:59:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>MS SQL &amp; Sybase: recreate master database</title>
		<link>http://www.memosoup.com/20090928/ms-sql-sybase-recreate-master-database.html</link>
		<comments>http://www.memosoup.com/20090928/ms-sql-sybase-recreate-master-database.html#comments</comments>
		<pubDate>Mon, 28 Sep 2009 10:54:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MS SQL]]></category>
		<category><![CDATA[Sybase]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[recreate]]></category>

		<guid isPermaLink="false">http://www.memosoup.com/?p=180</guid>
		<description><![CDATA[<p>Sybase:
before 12.5: buildmaster (bldmatr for NT)</p>
buildmaster -d master_device -s size_in_2k_pages
<p>12.5 and later: dataserver with some options (sqlsvr for NT)</p>
dataserver -d master_device -b size -forcebuild -z page_size -Z size_of_master_db
<p>MS SQL:</p>
<p>before MS 2005:
rebuildm utility (GUI)</p>
<p>MS SQL 2005:</p>

Start server in single-user mode (sqlserver.exe -m)
setup.exe /qn INSTANCENAME=instance_name REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=new_SA_Password
Restart server in [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Sybase:</strong><br />
<strong>before 12.5</strong>: buildmaster (bldmatr for NT)</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">buildmaster -d master_device -s size_in_2k_pages</div></div>
<p><strong>12.5 and later</strong>: dataserver with some options (sqlsvr for NT)</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">dataserver -d master_device -b size -forcebuild -z page_size -Z size_of_master_db</div></div>
<p><strong>MS SQL:</strong></p>
<p><strong>before MS 2005:</strong><br />
<em><strong>rebuildm</strong></em> utility (GUI)</p>
<p><strong>MS SQL 2005:</strong></p>
<ol>
<li>Start server in single-user mode (sqlserver.exe -m)</li>
<li>setup.exe /qn INSTANCENAME=instance_name REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=new_SA_Password</li>
<li>Restart server in normal mode</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.memosoup.com/20090928/ms-sql-sybase-recreate-master-database.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MS SQL: long running queries</title>
		<link>http://www.memosoup.com/20090923/ms-sql-long-running-queries.html</link>
		<comments>http://www.memosoup.com/20090923/ms-sql-long-running-queries.html#comments</comments>
		<pubDate>Wed, 23 Sep 2009 11:37:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MS SQL]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://www.memosoup.com/?p=166</guid>
		<description><![CDATA[select spid,cmd,status,loginame,open_tran,
&#160; datediff &#40;s,last_batch,getdate&#40;&#41;&#41; as &#91;Waittime &#40;s&#41;&#93;
from master..sysprocesses p 
where open_tran &#62; 0 
&#160; &#160; &#160; &#160; &#160; &#160;and spid &#62; 50 
&#160; &#160; &#160; &#160; &#160; and datediff &#40;s,last_batch,getdate&#40;&#41;&#41; &#62; 30 
&#160; &#160; &#160; &#160; &#160; and exists &#40; select * from master..syslockinfo 
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<div class="codecolorer-container tsql default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="tsql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0000FF;">select</span> spid,cmd,status,loginame,open_tran,<br />
&nbsp; <span style="color: #FF00FF;">datediff</span> <span style="color: #808080;">&#40;</span>s,last_batch,<span style="color: #FF00FF;">getdate</span><span style="color: #808080;">&#40;</span><span style="color: #808080;">&#41;</span><span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">as</span> <span style="color: #808080;">&#91;</span>Waittime <span style="color: #808080;">&#40;</span>s<span style="color: #808080;">&#41;</span><span style="color: #808080;">&#93;</span><br />
<span style="color: #0000FF;">from</span> master..<span style="color: #202020;">sysprocesses</span> p <br />
<span style="color: #0000FF;">where</span> open_tran <span style="color: #808080;">&gt;</span> <span style="color: #000;">0</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;and spid <span style="color: #808080;">&gt;</span> <span style="color: #000;">50</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; and <span style="color: #FF00FF;">datediff</span> <span style="color: #808080;">&#40;</span>s,last_batch,<span style="color: #FF00FF;">getdate</span><span style="color: #808080;">&#40;</span><span style="color: #808080;">&#41;</span><span style="color: #808080;">&#41;</span> <span style="color: #808080;">&gt;</span> <span style="color: #000;">30</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; and exists <span style="color: #808080;">&#40;</span> <span style="color: #0000FF;">select</span> <span style="color: #808080;">*</span> <span style="color: #0000FF;">from</span> master..<span style="color: #202020;">syslockinfo</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000FF;">where</span> req_spid<span style="color: #808080;">=</span>p.<span style="color: #202020;">spid</span> and rsc_type <span style="color: #808080;">&lt;&gt;</span><span style="color: #000;">2</span><span style="color: #808080;">&#41;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.memosoup.com/20090923/ms-sql-long-running-queries.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
