<?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>Dan Rigsby - Coding Up Style &#187; Tips</title>
	<atom:link href="http://www.danrigsby.com/blog/index.php/category/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.danrigsby.com/blog</link>
	<description>Developer.Speaker.Blogger</description>
	<lastBuildDate>Tue, 17 Nov 2009 18:29:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SQL Server 2008 Error: Saving changes is not permitted</title>
		<link>http://www.danrigsby.com/blog/index.php/2008/09/26/sql-server-2008-error-saving-changes-is-not-permitted/</link>
		<comments>http://www.danrigsby.com/blog/index.php/2008/09/26/sql-server-2008-error-saving-changes-is-not-permitted/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 21:05:00 +0000</pubDate>
		<dc:creator>Dan Rigsby</dc:creator>
				<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.danrigsby.com/blog/?p=593</guid>
		<description><![CDATA[If you have been playing with SQL Server Management Studio 2008 and are modifying tables in the designer, you may run into this error:
Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created.&#160; You have either made changes to a table that can’t be re-created or [...]]]></description>
			<content:encoded><![CDATA[<p>If you have been playing with SQL Server Management Studio 2008 and are modifying tables in the designer, you may run into this error:</p>
<blockquote><p>Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created.&#160; You have either made changes to a table that can’t be re-created or enabled the option Prevent saving changes that require the table to be re-created.</p>
</blockquote>
<p><em>Here is a screenshot:</em></p>
<p><a href="http://www.danrigsby.com/blog/wp-content/uploads/2008/09/ssms1.png"><img title="SSMS1" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="237" alt="SSMS1" src="http://www.danrigsby.com/blog/wp-content/uploads/2008/09/ssms1-thumb.png" width="533" border="0" /></a></p>
<p>In the 2008 , they have added a new option to prevent saving of changes that will require a table re-creation.&#160; If you think about it, this is a good thing.&#160; If you are running a production database, you want maximum performance.&#160; If Management Studio needs to re-create a table to apply a change that means it needs to create a copy of the table, transfer the data, create the new table, move the data over, delete the old stuff, etc.&#160; This can potentially be a major operation.&#160; </p>
<p>However, if you don’t want this feature enabled or our just working with a development or test database, it is easy to turn off.&#160; Just open up the Options window in Management Studio and go to “Designers –&gt; &quot;Table and Database Designers”, find the “Prevent saving changes that require table re-creation” option, and turn it off.</p>
<p><a href="http://www.danrigsby.com/blog/wp-content/uploads/2008/09/ssms2.png"><img title="SSMS2" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="371" alt="SSMS2" src="http://www.danrigsby.com/blog/wp-content/uploads/2008/09/ssms2-thumb.png" width="644" border="0" /></a></p>
<div class="wlWriterHeaderFooter" style="text-align:left; margin:0px; padding:4px 4px 4px 4px;"><a href="http://www.dotnetkicks.com/kick/?url=http://www.danrigsby.com/blog/?p=593"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://www.danrigsby.com/blog/?p=593&amp;bgcolor=FF8000&amp;fgcolor=FFFFFF&amp;border=000000&amp;cbgcolor=D4E1ED&amp;cfgcolor=000000" alt="DotNetKicks Image" border="0/"></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.danrigsby.com/blog/index.php/2008/09/26/sql-server-2008-error-saving-changes-is-not-permitted/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Remotely Log Off Remote Desktop Users</title>
		<link>http://www.danrigsby.com/blog/index.php/2008/08/26/remotely-log-off-remote-desktop-users/</link>
		<comments>http://www.danrigsby.com/blog/index.php/2008/08/26/remotely-log-off-remote-desktop-users/#comments</comments>
		<pubDate>Tue, 26 Aug 2008 15:31:00 +0000</pubDate>
		<dc:creator>Dan Rigsby</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.danrigsby.com/blog/?p=378</guid>
		<description><![CDATA[I frequently use Remote Desktop to access various PCs here at work and nothing annoys me more than seeing this message box:

This is caused when “The terminal server has exceeded the maximum number of allowed connections.”, right?&#160; Basically, this happens because Windows by default only allows two simultaneous terminal services connections to the same machine.&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>I frequently use Remote Desktop to access various PCs here at work and nothing annoys me more than seeing this message box:</p>
<p><a href="http://www.danrigsby.com/blog/wp-content/uploads/2008/08/remotedesktopexceeed1.gif"><img title="RemoteDesktopExceeed" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="123" alt="RemoteDesktopExceeed" src="http://www.danrigsby.com/blog/wp-content/uploads/2008/08/remotedesktopexceeed-thumb1.gif" width="462" border="0" /></a></p>
<p>This is caused when “The terminal server has exceeded the maximum number of allowed connections.”, right?&#160; Basically, this happens because Windows by default only allows two simultaneous terminal services connections to the same machine.&#160; If you see this message, then there is already that number of people logged in, and you cannot connect until one of the sessions logs off.</p>
<p>Usually what happens is that people don’t explicitly log out of machines when they disconnect from remote desktop which causes their “rogue” sessions to remain active.&#160; You could just nicely ask everyone if they would please “log off” before disconnecting their sessions, but is there something else we can do?</p>
<p><em>To perform the commands I am about to show you, you need to be an administrator on the target machine.&#160; If you aren’t you can’t perform these commands.&#160; However, in most development and test environments, hopefully this won’t be an issue.</em></p>
<h2>How to query for users on a machine</h2>
<p>First, how can we query to find out what users have a session on a remote machine?&#160; Windows provides the <a href="http://www.processarchive.com/process/qwinsta">qwinsta.exe</a> command which we can use to query for the sessions that are running&#160; The format is as follows:</p>
<div>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">qwinsta /server:<em>&lt;serverName&gt;</em></pre>
</div>
<div>&#160;</div>
<p>Here is an example running this command against one of my local machines.&#160; Notice it shows the username, state, and the ID of the session.</p>
<p><a href="http://www.danrigsby.com/blog/wp-content/uploads/2008/08/cmd3.gif"><img title="cmd3" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="145" alt="cmd3" src="http://www.danrigsby.com/blog/wp-content/uploads/2008/08/cmd3-thumb.gif" width="681" border="0" /></a> </p>
<p>You can also use <a href="http://www.processarchive.com/index.php?entry=quser&amp;rewr=1">quser.exe</a>:</p>
<div>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">quser /server:<em>&lt;serverName&gt;</em></pre>
</div>
<div>&#160;</div>
<div>Here is the same example above but notice it also when they logged in and how long they were idle.</div>
<p><a href="http://www.danrigsby.com/blog/wp-content/uploads/2008/08/cmd1.gif"><img title="cmd1" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="104" alt="cmd1" src="http://www.danrigsby.com/blog/wp-content/uploads/2008/08/cmd1-thumb.gif" width="713" border="0" /></a></p>
<h2>How to log a user off of a machine</h2>
<p>Now that we know what users are on a machine, how can we force one to disconnect? Again, there is a handy little command called <a href="http://www.processarchive.com/process/logoff">logoff.exe</a> that we can use to force a user to log off of a machine based off of their session ID.&#160; The format is as follows:</p>
<div>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">logoff <em>&lt;sessionId&gt;</em> /server:<em>&lt;serverName&gt;</em></pre>
</div>
<div>&#160;</div>
<p>Here is an example running this command against one of my local machines.&#160; Notice that I used the session ID that I found from the <a href="http://www.processarchive.com/index.php?entry=quser&amp;rewr=1">quser.exe</a> command above.</p>
<p><a href="http://www.danrigsby.com/blog/wp-content/uploads/2008/08/cmd2.gif"><img title="cmd2" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="92" alt="cmd2" src="http://www.danrigsby.com/blog/wp-content/uploads/2008/08/cmd2-thumb.gif" width="392" border="0" /></a></p>
<p><em>Warning: If you remotely log off a user, their log session goes away which could mean that the unsaved data is lost, or if the user is in the middle of an activity, they may come down to your office to chew you out.</em></p>
<div><a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.danrigsby.com%2fblog%2f%3fp%3d378"><img alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.danrigsby.com%2fblog%2f%3fp%3d378&amp;bgcolor=FF9900" border="0" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.danrigsby.com/blog/index.php/2008/08/26/remotely-log-off-remote-desktop-users/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>

