<?xml version="1.0" encoding="UTF-8" ?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Timothy Ford</title><subtitle type="html" /><id>http://www.simple-talk.com/community/blogs/timothy_ford/atom.aspx</id><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/timothy_ford/default.aspx" /><link rel="self" type="application/atom+xml" href="http://www.simple-talk.com/community/blogs/timothy_ford/atom.aspx" /><generator uri="http://communityserver.org" version="2.0.60217.2664">Community Server</generator><updated>2007-09-19T18:39:00Z</updated><entry><title>Do I Ask Too Much of My Beloved RDBMS?</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/timothy_ford/archive/2007/10/16/38392.aspx" /><id>http://www.simple-talk.com/community/blogs/timothy_ford/archive/2007/10/16/38392.aspx</id><published>2007-10-16T21:45:00Z</published><updated>2007-10-16T21:45:00Z</updated><content type="html">&lt;P&gt;OK&amp;nbsp;Simple-Talkers I have a interesting situation driving be nuttier than squirrel poo.&lt;/P&gt;
&lt;P&gt;I have the following 2 steps in a scheduled SQL job I use to backup logs.&amp;nbsp; If for some reason a log file does not exist it will throw the error 22049.&amp;nbsp; I trap for it and want it to proceed with the remainder of the step before completing the job.&amp;nbsp; The issue I have is that if any error is raised in a SQL job step you have limited options: Quit Reporting Success, Quit Reporting Failure, or Go To Step X.&amp;nbsp; I need it to &lt;U&gt;complete&lt;/U&gt; the step before making that decision.&amp;nbsp; That is not one of the options.&amp;nbsp; The action occurs on the first error - whether or not the error is handled gently.&amp;nbsp; If any error occurs the step stops.&lt;/P&gt;
&lt;P&gt;Do I ask too much of the RDBMS I love so?!?&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;--STEP 1&amp;nbsp; BACK UP LOGS&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;DECLARE @folder_name nvarchar(500)&lt;BR&gt;DECLARE @name sysname&lt;BR&gt;DECLARE @file nvarchar (1000)&lt;/P&gt;
&lt;P&gt;DECLARE @dirtree&amp;nbsp;table (subdirectory nvarchar(255), depth int)&lt;/P&gt;
&lt;P&gt;SET @folder_name = '\\SQLBackup\Backup'&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;INSERT @dirtree&lt;BR&gt;EXEC master.sys.xp_dirtree @folder_name&lt;/P&gt;
&lt;P&gt;DECLARE backup_cur&amp;nbsp;CURSOR FOR&lt;BR&gt;&amp;nbsp;SELECT name &lt;BR&gt;&amp;nbsp;FROM master.sys.databases&lt;BR&gt;&amp;nbsp;WHERE&amp;nbsp;name NOT IN ('master', 'model', 'msdb', 'tempdb')&lt;BR&gt;&amp;nbsp;&amp;nbsp;AND&amp;nbsp;recovery_model_desc &amp;lt;&amp;gt; 'SIMPLE'&lt;BR&gt;&amp;nbsp;&amp;nbsp;AND&amp;nbsp;DATEDIFF(day, create_date, GETDATE()) &amp;gt;= 1&amp;nbsp;&amp;nbsp;-- Must perform 1 full backup before you can do log backups.&lt;BR&gt;&amp;nbsp;&amp;nbsp;AND&amp;nbsp;name NOT IN &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;(&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;SELECT database_nm &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;FROM iDBA.backups.ignore_databases&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;BR&gt;&amp;nbsp;ORDER BY name&lt;/P&gt;
&lt;P&gt;OPEN backup_cur&lt;/P&gt;
&lt;P&gt;FETCH NEXT FROM backup_cur INTO @name&lt;/P&gt;
&lt;P&gt;WHILE @@FETCH_STATUS = 0&lt;BR&gt;&amp;nbsp;BEGIN&lt;BR&gt;&amp;nbsp;&amp;nbsp;SET @folder_name = '\\SQLBackup\Backup\' + @name&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;IF NOT EXISTS (SELECT 1 FROM @dirtree WHERE subdirectory = @name)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;EXECUTE master.dbo.xp_create_subdir @folder_name&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;SET @file = @folder_name + '\' + @name + '_tlog_' + CONVERT(NVARCHAR, GETDATE(), 112) + LEFT(REPLACE(CONVERT(VARCHAR, GETDATE(), 108), ':', ''), 4)+ '.trn'&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;BACKUP LOG @name&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;TO DISK = @file&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;WITH RETAINDAYS = 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;INSERT iDBA.backups.db_log_backups&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;VALUES (@name, @file, GETDATE(), DATEADD(dd, 1, GETDATE()), NULL)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;FETCH NEXT FROM backup_cur INTO @name&lt;BR&gt;&amp;nbsp;&amp;nbsp;END&lt;/P&gt;
&lt;P&gt;CLOSE backup_cur&lt;BR&gt;DEALLOCATE backup_cur&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;--STEP 2 DELETE EXPIRED BACKUP FILES&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;BEGIN TRAN&lt;BR&gt;&amp;nbsp;DECLARE @backup_file&amp;nbsp;nvarchar(1000)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;DECLARE del_cur CURSOR FOR&lt;BR&gt;&amp;nbsp;&amp;nbsp;SELECT backup_full_file_nm&lt;BR&gt;&amp;nbsp;&amp;nbsp;FROM iDBA.backups.db_log_backups&lt;BR&gt;&amp;nbsp;&amp;nbsp;WHERE database_nm NOT IN ('master', 'model', 'msdb', 'tempdb')&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;AND&amp;nbsp;backup_expiration_dt &amp;lt;= GETDATE()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;AND backup_removed_dt IS NULL&lt;BR&gt;&amp;nbsp;&amp;nbsp;ORDER BY database_nm&lt;/P&gt;
&lt;P&gt;&amp;nbsp;OPEN del_cur&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;BR&gt;&amp;nbsp;FETCH NEXT FROM del_cur INTO @backup_file&lt;/P&gt;
&lt;P&gt;&amp;nbsp;WHILE @@FETCH_STATUS = 0&lt;BR&gt;&amp;nbsp;&amp;nbsp;BEGIN&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;BEGIN TRY&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;EXEC master.sys.xp_delete_file 0, @backup_file&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PRINT CAST('Deleted File:&amp;nbsp; ' + @backup_file AS nvarchar(120))&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;END TRY&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;BEGIN CATCH&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;IF @@ERROR &amp;lt;&amp;gt; 22049&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;BEGIN&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DECLARE @err_msg&amp;nbsp;NVARCHAR (2000)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DECLARE @err_sev INT&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DECLARE @err_state&amp;nbsp;INT&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SELECT @err_msg = ERROR_MESSAGE()&amp;nbsp;, @err_sev = ERROR_SEVERITY(), @err_state = ERROR_STATE()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;RAISERROR (@err_msg, @err_sev, @err_state)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;END&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ELSE&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;BEGIN&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PRINT CAST('Missing File:&amp;nbsp; ' + @backup_file AS nvarchar(120))&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;END&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;END CATCH&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;UPDATE&amp;nbsp;iDBA.backups.db_log_backups&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;SET backup_removed_dt = GETDATE()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;WHERE&amp;nbsp;backup_full_file_nm = @backup_file&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;FETCH NEXT FROM del_cur INTO @backup_file&lt;BR&gt;&amp;nbsp;&amp;nbsp;END&lt;/P&gt;
&lt;P&gt;&amp;nbsp;CLOSE del_cur&lt;BR&gt;&amp;nbsp;DEALLOCATE del_cur&lt;BR&gt;&lt;BR&gt;IF @@TRANCOUNT &amp;gt; 0 COMMIT TRAN&lt;/P&gt;&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=38392" width="1" height="1"&gt;</content><author><name>Tim Ford</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=10587</uri></author></entry><entry><title>PASS Day 3:  Hello Muddah, Hello Faddah</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/timothy_ford/archive/2007/09/23/37536.aspx" /><id>http://www.simple-talk.com/community/blogs/timothy_ford/archive/2007/09/23/37536.aspx</id><published>2007-09-23T17:25:00Z</published><updated>2007-09-23T17:25:00Z</updated><content type="html">&lt;P class=MsoNormal&gt;&lt;FONT face=Calibri&gt;Here it is, the last day of PASS 2007 and I find myself in a melancholy that comes with the last day of summer camps from many years past.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;We are all far past the stage of being exhausted, yet not ready to seek out the family come to collect me and take that long silent trip home.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;It’s been three days of breakout sessions, hands-on labs, and vendor expo visitations.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;For a few of us, you can add sponsor parties, volunteer training sessions, media interviews, PASS Board business meetings, stints as Ambassadors and in my case Game Show Host.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Calibri&gt;Now I find myself with some of the friends I’ve made through PASS over the years: a few Microsoft MVPs, a couple of candidates for the PASS Board, a spattering of other fellow volunteers and even a few new friends I’ve made this year, all making plans for a final dinner together.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;I’ve just completed my final session, this one a topic I hold great value in: Telecommuting. &lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;It was a fitting end to the week, considering I spent quite a few hours doing just that from sessions and hallways of the Colorado Convention Center.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;How to work effectively from anywhere in the world with the proper tools is quite easy.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;I’ve done it for almost eight years myself and am an advocate for telecommuting.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;The responsibilities of a DBA are quite suited to telecommuting.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Calibri&gt;The workload of the week is apparently getting to the best of us.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;E-Board Rick (yes, the same Rick from Tony Davis’ post on the horrors of PASS registration) has just wandered over with a camera.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;Apparently outgoing President Kevin Kline is asleep on a table around the corner.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;I guess after eight years he is afforded some latitude in slacking-off during the last hour of the Summit. &lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=37536" width="1" height="1"&gt;</content><author><name>Tim Ford</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=10587</uri></author></entry><entry><title>PASS Day Two:  You Can't Get There From Here (A Geog-DUH-phy Lesson)</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/timothy_ford/archive/2007/09/21/37497.aspx" /><id>http://www.simple-talk.com/community/blogs/timothy_ford/archive/2007/09/21/37497.aspx</id><published>2007-09-21T14:23:00Z</published><updated>2007-09-21T14:23:00Z</updated><content type="html">&lt;P&gt;Here it is day two and I am finally starting to get adjusted to the time difference.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Wimp.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Sure, I thought I had it bad.&amp;nbsp; Two entire time zones between my native Michigan and Denver.&amp;nbsp; I always lose touch with&amp;nbsp;just how global PASS is.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;I was attending Peter Ward's&amp;nbsp;fantastic spotlight session on Engineering for the DBA and leaned over to a fellow attendee that I've become friends with through years of volunteerism (see a trend here) and had him note the time on Peter's laptop that he was using for the presentation:&amp;nbsp; &lt;/P&gt;
&lt;P&gt;9:30 am.&lt;/P&gt;
&lt;P&gt;This was 5:30 pm.&amp;nbsp; This was also my &lt;EM&gt;stop complaining&lt;/EM&gt; moment.&lt;/P&gt;
&lt;P&gt;There is some bloke named Tony from the U.K.&amp;nbsp; Says he's an editor of some sort for something called Simple Talk.&amp;nbsp; The U.K., for those who are not geographically savy, is a small land-locked country that borders with Nepal. It's&amp;nbsp;leading export is boiled meat; and it is the only country with a period in it's name.&amp;nbsp; At least that's what it said on Wikipedia.&amp;nbsp; That must be about 7 hours different from the mountains of Colorado!&lt;/P&gt;
&lt;P&gt;Then you have Gail Shaw, second-year attendee from South Africa whom I met last year when she answered a question from the audience on the SIG Quizbowl.&amp;nbsp; She was back this year and was up on stage with me this year as a contestant.&amp;nbsp; I am not sure how far in the future she normally lives, my brain is full so I am abstaining from math for the remainder of the week, but I am going to approximate that she is 42 hours ahead of Denver.&amp;nbsp; My estimate may be a little high or low, but I don't care any longer.&lt;/P&gt;
&lt;P&gt;There are so many others:&amp;nbsp; Johan and Christoph from Germany (another country bordering Nepal according to Wiki), Greg from Australia, Louis from North Carolina (I believe that is Puerto Rico), Dan from the exotic island of Seattle.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;These are some of the people you're in sessions with from 0800 - 1800.&amp;nbsp; These are the friends you make from years of participation.&amp;nbsp; These are the fellow SQL professionals, Microsoft MVPs, and Speakers&amp;nbsp;that you are out "brainstorming" with until 0200 &lt;U&gt;after&lt;/U&gt; those long days in classes and meetings.&lt;/P&gt;
&lt;P&gt;You learn a great deal about SQL Server and the platforms it runs on from these long days in class.&amp;nbsp; Just as valuable are those late nights/early mornings out at the vendor parties and pub crawls.&amp;nbsp; That's when you learn the politics of people in&amp;nbsp;our industry, you collaborate on problems you're having back at work and perhaps&amp;nbsp;find a new perspective on getting your job done.&amp;nbsp; You may even learn just how much Jagermeister a DBA can consume before he'll get on stage at a Karoke bar.&amp;nbsp;&amp;nbsp;Most-importantly, you realize you're not alone in your&amp;nbsp;experiences.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Sure, after&amp;nbsp;clocking subsequent 17 hour days I am tired.&amp;nbsp; But it is a &lt;EM&gt;good &lt;/EM&gt;tired.&amp;nbsp;&lt;/P&gt;&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=37497" width="1" height="1"&gt;</content><author><name>Tim Ford</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=10587</uri></author></entry><entry><title>It's PASS 2007 Arg!</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/timothy_ford/archive/2007/09/19/37436.aspx" /><id>http://www.simple-talk.com/community/blogs/timothy_ford/archive/2007/09/19/37436.aspx</id><published>2007-09-19T22:39:00Z</published><updated>2007-09-19T22:39:00Z</updated><content type="html">&lt;P&gt;Volunteer meetings, PASS business, PASS SIG Quizbowl, Welcome Reception, SQL Server Central Party&amp;nbsp;and the subsequent after party and after-after party, General Session and four breakout sessions and man is my brain tired!&lt;/P&gt;
&lt;P&gt;It's all just a part of being at PASS and being &lt;U&gt;involved&lt;/U&gt; in PASS.&amp;nbsp; Sure it is a great deal of work, but it is also a great deal of fun.&amp;nbsp; It was brought up in our day-long volunteer meeting yesterday that you may be an attendee, but until you volunteer in some level, you don't really feel like a member of the community.&amp;nbsp; From someone who has been a volunteer since their first summit in January 2002 it is hard to explain what that sense of community feels like.&amp;nbsp; It's akin to explaining a sunset to a blind person.&amp;nbsp; Well, maybe I am prone to hyperbole.&lt;/P&gt;
&lt;P&gt;The general session provided a nice inside look at some of the upcoming features of (surprise) SQL Server 2008.&amp;nbsp; It was also noted that there will be no price increase for 2008 versus 2005.&lt;/P&gt;
&lt;P&gt;After the general session it was time to make those hard choices that come with wanting to be in two or more places at a time:&amp;nbsp; which sessions to take?&amp;nbsp; The good news with PASS 2007 is that each session is being recorded and attendees will be able to view them online at a later time on demand.&amp;nbsp; On that note I chose the following sessions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Notification Services, by Joe Webb&lt;/P&gt;
&lt;P&gt;Optimizing High Performance SQL Systems Using Lessons Learned From Customer Deployments (A Microsoft-presented session that used MySpace as the basis of the discussion) &lt;/P&gt;
&lt;P&gt;Database Recovery For The Paranoid DBA, by James Luetkehoelter (always an engaging speaker.)&lt;/P&gt;
&lt;P&gt;Disk Configuration for the Microsoft SQL Server DBA, by Allan Hirt&lt;/P&gt;
&lt;P&gt;Now it's on to the vendor exposition to pimp myself out for swag.&amp;nbsp; The kids need more tee-shirts to sleep in!&lt;/P&gt;
&lt;P&gt;Oh, James L. reminded us that it was International Talk Like A Pirate Day!&amp;nbsp; (Wow, hard to believe it's been a year since the last one.)&amp;nbsp; So on that note let me close by saying &lt;/P&gt;
&lt;P&gt;&lt;FONT size=5&gt;Gar Maytee!&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=37436" width="1" height="1"&gt;</content><author><name>Tim Ford</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=10587</uri></author></entry></feed>