<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.sqlservercentral.com/blogs/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>James Howards SQL Blog - All Comments</title><link>http://www.sqlservercentral.com/blogs/james_howards_sql_blog/default.aspx</link><description>James Howard is a Microsoft certified SQL Server DBA who has been working with the product within a variety of industries including financial, legal, and political. He has been a DBA since 2005 and first gained his Microsoft Certification in 2007.</description><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 20917.1142)</generator><item><title>re: Attaching a data file without the log file...</title><link>http://www.sqlservercentral.com/blogs/james_howards_sql_blog/archive/2009/11/18/attaching-a-data-file-without-the-log-file.aspx#18135</link><pubDate>Wed, 24 Feb 2010 11:49:46 GMT</pubDate><guid isPermaLink="false">70975365-724d-4ce8-8d1c-45c963ab81ff:18135</guid><dc:creator>erick-583394</dc:creator><description>&lt;p&gt;thanks really got me out of a bind.&lt;/p&gt;
&lt;img src="http://www.sqlservercentral.com/blogs/aggbug.aspx?PostID=18135" width="1" height="1"&gt;</description></item><item><title>re: Please, Sir, I want some more… orphaned database users.</title><link>http://www.sqlservercentral.com/blogs/james_howards_sql_blog/archive/2009/12/03/please-sir-i-want-some-more-orphaned-database-users.aspx#16446</link><pubDate>Mon, 21 Dec 2009 03:38:57 GMT</pubDate><guid isPermaLink="false">70975365-724d-4ce8-8d1c-45c963ab81ff:16446</guid><dc:creator>samir.santra</dc:creator><description>&lt;p&gt;Fantastic script.&lt;/p&gt;
&lt;img src="http://www.sqlservercentral.com/blogs/aggbug.aspx?PostID=16446" width="1" height="1"&gt;</description></item><item><title>re: Intellisense isn’t working? An IntelliSensible list of Common Causes</title><link>http://www.sqlservercentral.com/blogs/james_howards_sql_blog/archive/2009/11/26/intellisense-isn-t-working-an-intellisensible-list-of-common-causes.aspx#16210</link><pubDate>Thu, 10 Dec 2009 10:56:38 GMT</pubDate><guid isPermaLink="false">70975365-724d-4ce8-8d1c-45c963ab81ff:16210</guid><dc:creator>rahman82pk</dc:creator><description>&lt;p&gt;Checked all options. still unable to find solution to working with intellisense&lt;/p&gt;
&lt;img src="http://www.sqlservercentral.com/blogs/aggbug.aspx?PostID=16210" width="1" height="1"&gt;</description></item><item><title>re: Please, Sir, I want some more… orphaned database users.</title><link>http://www.sqlservercentral.com/blogs/james_howards_sql_blog/archive/2009/12/03/please-sir-i-want-some-more-orphaned-database-users.aspx#16102</link><pubDate>Fri, 04 Dec 2009 17:42:48 GMT</pubDate><guid isPermaLink="false">70975365-724d-4ce8-8d1c-45c963ab81ff:16102</guid><dc:creator>john.moreno</dc:creator><description>&lt;p&gt;Any particular reason you're not using:&lt;/p&gt;
&lt;p&gt;exec sp_change_users_login 'Report'&lt;/p&gt;
&lt;p&gt;I've ran into some permissions issue with it, but it generally works...&lt;/p&gt;
&lt;img src="http://www.sqlservercentral.com/blogs/aggbug.aspx?PostID=16102" width="1" height="1"&gt;</description></item><item><title>re: Please, Sir, I want some more… orphaned database users.</title><link>http://www.sqlservercentral.com/blogs/james_howards_sql_blog/archive/2009/12/03/please-sir-i-want-some-more-orphaned-database-users.aspx#16088</link><pubDate>Fri, 04 Dec 2009 14:39:57 GMT</pubDate><guid isPermaLink="false">70975365-724d-4ce8-8d1c-45c963ab81ff:16088</guid><dc:creator>wes_williams</dc:creator><description>&lt;p&gt;Nice one James. &amp;nbsp;I've also modified the script incorporating two changes. &amp;nbsp;First is Jonathan's change as we have a couple of databases with periods in the name. &amp;nbsp;Second, I've changed from a temp table to a table variable since it's a little cleaner if your server is new enough to support them.&lt;/p&gt;
&lt;img src="http://www.sqlservercentral.com/blogs/aggbug.aspx?PostID=16088" width="1" height="1"&gt;</description></item><item><title>re: Please, Sir, I want some more… orphaned database users.</title><link>http://www.sqlservercentral.com/blogs/james_howards_sql_blog/archive/2009/12/03/please-sir-i-want-some-more-orphaned-database-users.aspx#16082</link><pubDate>Fri, 04 Dec 2009 12:37:24 GMT</pubDate><guid isPermaLink="false">70975365-724d-4ce8-8d1c-45c963ab81ff:16082</guid><dc:creator>James Howard</dc:creator><description>&lt;p&gt;Good spot, I have amended my submission to the script area! Thanks Jonathan&lt;/p&gt;
&lt;img src="http://www.sqlservercentral.com/blogs/aggbug.aspx?PostID=16082" width="1" height="1"&gt;</description></item><item><title>re: Please, Sir, I want some more… orphaned database users.</title><link>http://www.sqlservercentral.com/blogs/james_howards_sql_blog/archive/2009/12/03/please-sir-i-want-some-more-orphaned-database-users.aspx#16079</link><pubDate>Fri, 04 Dec 2009 10:29:08 GMT</pubDate><guid isPermaLink="false">70975365-724d-4ce8-8d1c-45c963ab81ff:16079</guid><dc:creator>jonathan allen</dc:creator><description>&lt;p&gt;Nice script James, &lt;/p&gt;
&lt;p&gt;I simply had to adjust the line &amp;quot;...from ?..sysusers...&amp;quot; to be &amp;quot;...from [?]..sysusers...&amp;quot; as we have a couple of databases that use a hyphen &amp;quot;-&amp;quot; in their names!&lt;/p&gt;
&lt;p&gt;Thanks &lt;/p&gt;
&lt;img src="http://www.sqlservercentral.com/blogs/aggbug.aspx?PostID=16079" width="1" height="1"&gt;</description></item><item><title>re: Please, Sir, I want some more… orphaned database users.</title><link>http://www.sqlservercentral.com/blogs/james_howards_sql_blog/archive/2009/12/03/please-sir-i-want-some-more-orphaned-database-users.aspx#16078</link><pubDate>Fri, 04 Dec 2009 09:44:06 GMT</pubDate><guid isPermaLink="false">70975365-724d-4ce8-8d1c-45c963ab81ff:16078</guid><dc:creator>Tao Klerks</dc:creator><description>&lt;p&gt;slightly more efficient (because it avoids the function call), but using SQL2000 deprecated objects:&lt;/p&gt;
&lt;p&gt;	SELECT sysusers.name --, *&lt;/p&gt;
&lt;p&gt;	FROM sysusers&lt;/p&gt;
&lt;p&gt;	LEFT JOIN master.dbo.syslogins AS syslogins ON sysusers.sid = syslogins.sid&lt;/p&gt;
&lt;p&gt;	WHERE sysusers.islogin = 1&lt;/p&gt;
&lt;p&gt;		AND sysusers.isntname = 0&lt;/p&gt;
&lt;p&gt;		AND syslogins.sid Is Null&lt;/p&gt;
&lt;p&gt;		AND sysusers.sid Is Not Null&lt;/p&gt;
&lt;p&gt;		AND sysusers.sid &amp;lt;&amp;gt; 0x00&lt;/p&gt;
&lt;p&gt;		AND sysusers.sid &amp;lt;&amp;gt; 0x01&lt;/p&gt;
&lt;p&gt;		AND sysusers.uid &amp;lt;&amp;gt; 1&lt;/p&gt;
&lt;p&gt;I'm sure the same could easily be done using the 2005 and later management views.&lt;/p&gt;
&lt;img src="http://www.sqlservercentral.com/blogs/aggbug.aspx?PostID=16078" width="1" height="1"&gt;</description></item><item><title>re: Please, Sir, I want some more… orphaned database users.</title><link>http://www.sqlservercentral.com/blogs/james_howards_sql_blog/archive/2009/12/03/please-sir-i-want-some-more-orphaned-database-users.aspx#16077</link><pubDate>Fri, 04 Dec 2009 08:46:13 GMT</pubDate><guid isPermaLink="false">70975365-724d-4ce8-8d1c-45c963ab81ff:16077</guid><dc:creator>James Howard</dc:creator><description>&lt;p&gt;No I hadn't, good thinking - I have just added it now. I'll keep that section of the site in mind when blogging on other scripts in future... &amp;nbsp;thanks&lt;/p&gt;
&lt;img src="http://www.sqlservercentral.com/blogs/aggbug.aspx?PostID=16077" width="1" height="1"&gt;</description></item><item><title>re: Please, Sir, I want some more… orphaned database users.</title><link>http://www.sqlservercentral.com/blogs/james_howards_sql_blog/archive/2009/12/03/please-sir-i-want-some-more-orphaned-database-users.aspx#16072</link><pubDate>Thu, 03 Dec 2009 22:33:05 GMT</pubDate><guid isPermaLink="false">70975365-724d-4ce8-8d1c-45c963ab81ff:16072</guid><dc:creator>Steve Jones</dc:creator><description>&lt;p&gt;Nice, did you submit this in the Scripts section as well? So many people look there for this type of code.&lt;/p&gt;
&lt;img src="http://www.sqlservercentral.com/blogs/aggbug.aspx?PostID=16072" width="1" height="1"&gt;</description></item><item><title>Dew Drop &amp;#8211; December 2, 2009 | Alvin Ashcraft&amp;#039;s Morning Dew</title><link>http://www.sqlservercentral.com/blogs/james_howards_sql_blog/archive/2009/12/01/she-sells-powershell-on-the-sea-shore.aspx#16035</link><pubDate>Wed, 02 Dec 2009 13:42:24 GMT</pubDate><guid isPermaLink="false">70975365-724d-4ce8-8d1c-45c963ab81ff:16035</guid><dc:creator>Dew Drop – December 2, 2009 | Alvin Ashcraft's Morning Dew</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;Dew Drop &amp;amp;#8211; December 2, 2009 | Alvin Ashcraft&amp;amp;#039;s Morning Dew&lt;/p&gt;
&lt;img src="http://www.sqlservercentral.com/blogs/aggbug.aspx?PostID=16035" width="1" height="1"&gt;</description></item><item><title>re: She Sells PowerShell on The Sea Shore</title><link>http://www.sqlservercentral.com/blogs/james_howards_sql_blog/archive/2009/12/01/she-sells-powershell-on-the-sea-shore.aspx#16009</link><pubDate>Tue, 01 Dec 2009 15:37:41 GMT</pubDate><guid isPermaLink="false">70975365-724d-4ce8-8d1c-45c963ab81ff:16009</guid><dc:creator>Steve Jones</dc:creator><description>&lt;p&gt;Good list of articles. Send us some of your favorite code items that explain what you have done with it. I'd like to see more practical examples of where people have chosen it for specific tasks.&lt;/p&gt;
&lt;img src="http://www.sqlservercentral.com/blogs/aggbug.aspx?PostID=16009" width="1" height="1"&gt;</description></item><item><title>Dew Drop &amp;#8211; December 1, 2009 | Alvin Ashcraft&amp;#039;s Morning Dew</title><link>http://www.sqlservercentral.com/blogs/james_howards_sql_blog/archive/2009/12/01/she-sells-powershell-on-the-sea-shore.aspx#16002</link><pubDate>Tue, 01 Dec 2009 13:06:23 GMT</pubDate><guid isPermaLink="false">70975365-724d-4ce8-8d1c-45c963ab81ff:16002</guid><dc:creator>Dew Drop – December 1, 2009 | Alvin Ashcraft's Morning Dew</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;Dew Drop &amp;amp;#8211; December 1, 2009 | Alvin Ashcraft&amp;amp;#039;s Morning Dew&lt;/p&gt;
&lt;img src="http://www.sqlservercentral.com/blogs/aggbug.aspx?PostID=16002" width="1" height="1"&gt;</description></item><item><title>re: Common Forum Queries: Calculate age from the date of birth</title><link>http://www.sqlservercentral.com/blogs/james_howards_sql_blog/archive/2009/11/25/common-forum-queries-calculate-age-from-the-date-of-birth.aspx#15949</link><pubDate>Fri, 27 Nov 2009 09:16:43 GMT</pubDate><guid isPermaLink="false">70975365-724d-4ce8-8d1c-45c963ab81ff:15949</guid><dc:creator>Mitesh Oswal</dc:creator><description>&lt;p&gt;DECLARE @date datetime, &lt;/p&gt;
&lt;p&gt;@tmpdate datetime, &lt;/p&gt;
&lt;p&gt;@years int, &lt;/p&gt;
&lt;p&gt;@months int, &lt;/p&gt;
&lt;p&gt;@days int&lt;/p&gt;
&lt;p&gt;SELECT @date = &amp;#39;11/26/80&amp;#39;&lt;/p&gt;
&lt;p&gt;SELECT &lt;/p&gt;
&lt;p&gt;	@years	=	DATEDIFF(yy,@date,GETDATE())&lt;/p&gt;
&lt;p&gt;SELECT&lt;/p&gt;
&lt;p&gt;	@date=	DATEADD(yy,@years,@date)&lt;/p&gt;
&lt;p&gt;SELECT&lt;/p&gt;
&lt;p&gt;	@months		=	DATEDIFF(mm,@date,GETDATE())&lt;/p&gt;
&lt;p&gt;SELECT&lt;/p&gt;
&lt;p&gt;	@date	=	DATEADD(mm,@months,@date)&lt;/p&gt;
&lt;p&gt;SELECT&lt;/p&gt;
&lt;p&gt;	@days	=	DATEDIFF(dd,@date,GETDATE())&lt;/p&gt;
&lt;p&gt;SELECT &lt;/p&gt;
&lt;p&gt;	CASE WHEN (@days &amp;lt;= 0 AND @months &amp;lt;= 0 ) &amp;nbsp;THEN @years - 1 ELSE @years END AS &amp;quot;Year&amp;quot;,&lt;/p&gt;
&lt;p&gt;	CASE WHEN (@days &amp;lt;= 0 AND @months &amp;lt; 0 ) THEN &amp;nbsp;12+@Months-1 &lt;/p&gt;
&lt;p&gt;	ELSE CASE WHEN @months &amp;lt; 0 &amp;nbsp;THEN 11 ELSE @months END END MONTHS,&lt;/p&gt;
&lt;p&gt;	CASE WHEN @days &amp;lt; 0 THEN 31+@days ELSE @days END AS Days&lt;/p&gt;
&lt;img src="http://www.sqlservercentral.com/blogs/aggbug.aspx?PostID=15949" width="1" height="1"&gt;</description></item><item><title>re: Maintenance Plan clean up task - not working to plan</title><link>http://www.sqlservercentral.com/blogs/james_howards_sql_blog/archive/2009/11/19/maintenance-clean-up-task-not-working-to-plan.aspx#15857</link><pubDate>Tue, 24 Nov 2009 06:50:13 GMT</pubDate><guid isPermaLink="false">70975365-724d-4ce8-8d1c-45c963ab81ff:15857</guid><dc:creator>rd_in_sd</dc:creator><description>&lt;p&gt;The things you are mentioning may or may not fix the problem. &amp;nbsp;I did a lot of Google searches too and tried this on every possible permutation of xp_delete_files. &amp;nbsp;Also, upgraded the service packs and applied hot-fixes on test servers. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;The problems with this XP are several. &amp;nbsp;The same code works on some servers but not others. MS includes it in maintenance plans as an undocumented extended procedure, and it will be deprecated in future releases or SQL Server. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;I took the advice of a few DBA's out there in the cloud and wrote a PowerShell script that does it flawlessly, irrespective of hardware or SQL Server versions. &amp;nbsp;It takes about a day to figure it out and customize it to your environment (another day to deploy) but really worth the effort.&lt;/p&gt;
&lt;p&gt;Ron&lt;/p&gt;
&lt;img src="http://www.sqlservercentral.com/blogs/aggbug.aspx?PostID=15857" width="1" height="1"&gt;</description></item></channel></rss>