<?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>Allen Kinsel &#8211; SQL DBA</title>
	<atom:link href="http://www.allenkinsel.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.allenkinsel.com</link>
	<description>SQL Server, PASS, and other data mishaps</description>
	<lastBuildDate>Tue, 12 Jul 2016 15:24:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.0.3</generator>
	<item>
		<title>TSQL Tuesday #80 &#8211; AKA Chris Yates&#8217;s Birthday</title>
		<link>http://www.allenkinsel.com/archive/2016/07/tsql-tuesday-80-aka-chris-yatess-birthday/</link>
					<comments>http://www.allenkinsel.com/archive/2016/07/tsql-tuesday-80-aka-chris-yatess-birthday/#comments</comments>
		
		<dc:creator><![CDATA[Allen Kinsel]]></dc:creator>
		<pubDate>Tue, 12 Jul 2016 15:11:38 +0000</pubDate>
				<category><![CDATA[Ramblings]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Syndicated]]></category>
		<category><![CDATA[babble]]></category>
		<category><![CDATA[tsql2sday]]></category>
		<guid isPermaLink="false">http://www.allenkinsel.com/?p=1478</guid>

					<description><![CDATA[Its the 80th T-SQL Tuesday and for some reason I decided to write a blog post.  This month&#8217;s host is a good friend, Chris Yates and since its his birthday he decided to give us a gift by opening the topic to &#8220;anything&#8221; My topic of choice is simple and relates to Chris&#8217;s Present. SQL Server&#8217;s [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" class="alignnone" src="https://chrisyatessql.files.wordpress.com/2016/07/tsql2sday-150x150.png?w=700" width="150" height="150" /></p>
<p>Its the 80th T-SQL Tuesday and for some reason I decided to write a blog post.  This month&#8217;s host is a good friend, <a href="https://chrisyatessql.wordpress.com/2016/07/06/t-sql-tuesday-080/">Chris Yates</a> and since its his birthday he decided to give us a gift by opening the topic to &#8220;anything&#8221;</p>
<p>My topic of choice is simple and relates to Chris&#8217;s Present. <strong>SQL Server&#8217;s Birthday.  </strong></p>
<p>I&#8217;ve worked with SQL Server in some form for longer than I care to admit so I thought it would be interesting to write down my memories of each release.  Why? I dont know, I guess because I can and perhaps just perhaps to compare notes with a few other &#8220;old-timers&#8221;</p>
<p>&nbsp;</p>
<p>SQL Releases over the years<strong>  </strong></p>
<p>SQL 6.5</p>
<ul>
<li>a GUI on a DB? This was sheer madness</li>
<li>SQL Enterprise manager was revolutionary &amp; light years ahead of the competition</li>
<li>Corruption, Corruption Corruption</li>
<li>I still miss ISQL_w sometimes (not really)</li>
<li>Shipped with actual printed books</li>
</ul>
<p>SQL 7.0</p>
<ul>
<li>Side by side unusable installs of SQL 6.5 and 7.0 during upgrades</li>
<li>I do miss the standalone Query Analyzer tool</li>
<li>DTS&#8230; oh the nightmares of DTS, they all start here</li>
</ul>
<p>SQL 2000</p>
<ul>
<li>Someone put XML in a database&#8230; AKA: Patient zero</li>
<li>You get a bigint and you get a bigint and you, bigints for everyone!</li>
<li>There was a disturbance in the force and SSRS appeared (Someone say it was SSAS that caused the disturbance but I disagree)</li>
<li>Put multiple instances of SQL on a server they said, it&#8217;ll be fun they said&#8230;&#8230; NOT</li>
</ul>
<p>SQL 2005</p>
<ul>
<li>SSIS appears, the lights suddenly dim and a clown jumps out of a box and says &#8220;Surprise&#8221;</li>
<li>Upgrade pain like no other &#8220;80&#8221; compatibility still haunts many-a-DBA</li>
<li>CLR is banished by DBA&#8217;s everywhere for being the devils magic and clearly evil</li>
<li>DTA appears and is quickly crowned with a dunce cap</li>
<li>SSNS came and went so quickly no one ever saw it</li>
<li>TSQL Window functions appear and developers rejoice!</li>
<li>BIDS shows up and BI developers lives are never the same</li>
</ul>
<p>SQL 2008</p>
<ul>
<li>PBM appears and quickly goes stale</li>
<li>Compression of all the things arrives but only if you spend mega bucks</li>
<li>DMV&#8217;s finally became useful</li>
<li>intellisense? what is this dark art that saves me from typing SLECT 1 more time</li>
<li>AlwaysOn, Alwayson, Always on, Who knows what it will be called today but the moniker appeared and <a href="http://sqlha.com/">Allan Hirt</a> suddenly had more grey hair</li>
</ul>
<p>SQL 2008R2</p>
<ul>
<li>The SQL team joined the &#8220;R2&#8221; Parade and quickly got lost</li>
<li>The what edition of SQL do I need to do X game gets into high gear</li>
<li>PowerName All the things starts with PowerPivot</li>
<li>MasterDataServices appears and quickly goes stale</li>
</ul>
<p>SQL 2012</p>
<ul>
<li>Core licensing appears and the value proposition gets instantly more complicated</li>
<li>SSIS was disemboweled (Thankfully)</li>
<li>Column Store indexes were created to give <a href="http://www.nikoport.com/columnstore/">Niko </a>something to write about</li>
<li>AlwaysOn Availability Groups make DBA&#8217;s look like superheros</li>
<li>Extended event shaming becomes a thing</li>
<li>BIDS? SSDT? SSDT-BI? Data tools? The confusion is maddening</li>
</ul>
<p>SQL 2014</p>
<ul>
<li>The what edition do I need game takes another twist</li>
<li>SSMS is still treated like a stepchild</li>
<li>Hekaton changes the game (If you meet this teeny tiny list of caveats)</li>
<li>Azure is melted into the box product</li>
</ul>
<p>SQL 2016</p>
<ul>
<li>Someone put JSON in a database&#8230; AKA: Patient zero</li>
<li>Dynamic data masking and Row level security brings all the auditors to the yard</li>
<li>AlwaysEncrypted continues the pattern of &#8220;Always or Power&#8221; all the names!</li>
<li>QueryStore appears and DBA&#8217;s the world over are immediately confused by this black magic</li>
<li>Temporal tables appear and SQL Server catches up with postgres circa 2012</li>
<li>SSMS starts getting major love, everyone wonders if its a trick</li>
<li>SSDT is&#8230; wait&#8230;for&#8230;it&#8230; a SINGLE tool finally!</li>
</ul>
<p>Future SQL Server</p>
<ul>
<li>Can we get indexes on <del>functions</del> expressions *pretty please* If a mainframe can do it surely SQL can too</li>
<li>Banish the message &#8220;string or binary data may be truncated&#8221; to the history books</li>
<li>How about a tiny touch of love for Powershell (those guys yell loud enough that powershell can cure all my ills, how about giving them a proper hammer)</li>
<li>An edition based on size of server, pay for the T-SQL features you use based on server/database size *things like hekaton on small db&#8217;s* in a new &#8220;AlwaysPower&#8221; edition</li>
<li>*basic* Scalar UDF optimization to cache deterministic values</li>
</ul>
<p>What did I miss?  Wait, I know I missed a lot so dont answer that.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://www.allenkinsel.com/archive/2016/07/tsql-tuesday-80-aka-chris-yatess-birthday/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>T-SQL Tuesday &#8211; Giving back to the SQL Community in 2015</title>
		<link>http://www.allenkinsel.com/archive/2014/12/t-sql-tuesday-giving-back-to-the-sql-community-in-2015/</link>
					<comments>http://www.allenkinsel.com/archive/2014/12/t-sql-tuesday-giving-back-to-the-sql-community-in-2015/#comments</comments>
		
		<dc:creator><![CDATA[Allen Kinsel]]></dc:creator>
		<pubDate>Tue, 09 Dec 2014 22:06:54 +0000</pubDate>
				<category><![CDATA[Ramblings]]></category>
		<category><![CDATA[SQLPASS]]></category>
		<category><![CDATA[Syndicated]]></category>
		<category><![CDATA[Volunteer]]></category>
		<category><![CDATA[Community]]></category>
		<guid isPermaLink="false">http://www.allenkinsel.com/?p=1452</guid>

					<description><![CDATA[This months TSQL Tuesday #61 is hosted by Wayne Sheffield on Giving Back to the SQL Server Community.  An interesting topic given the season and something that is near and dear.  Here&#8217;s his original post http://blog.waynesheffield.com/wayne/archive/2014/12/t-sql-tuesday-61-giving-back/ &#160; It seems like I have a knack for doing things backwards differently and my time giving to the [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" class="alignleft" src="http://blog.waynesheffield.com/wayne/wp-content/uploads/2012/04/TSQL2sDay150x150.jpg" alt="" width="150" height="150" />This months TSQL Tuesday #61 is hosted by Wayne Sheffield on Giving Back to the SQL Server Community.  An interesting topic given the season and something that is near and dear.  Here&#8217;s his original post <a href="http://blog.waynesheffield.com/wayne/archive/2014/12/t-sql-tuesday-61-giving-back/">http://blog.waynesheffield.com/wayne/archive/2014/12/t-sql-tuesday-61-giving-back/</a></p>
<p>&nbsp;</p>
<p>It seems like I have a knack for doing things <del>backwards</del> differently and my time giving to the SQL Community has largely followed that path!  In 2015 Ill be continuing my &#8220;different&#8221; trend of community impact through PASS from international/national to local!</p>
<p>As some of you might know, I&#8217;ve spent a good portion of the last nine (or is it ten?) years involved with PASS in a number of different roles.  From working on the precursor to our current Virtual Chapters to volunteering with the Program Committee for many years to serving on the nomcom multiple times, running a SQL Saturday and even being a Board Member. I have experience in almost every area of PASS.  I have grown both personally and professionally during the time that I&#8217;ve spent in those roles.  The overall communities growth in all these years always inspires me to do more and I don&#8217;t see this year being any different.</p>
<p>&nbsp;</p>
<p>Even though I don&#8217;t hold an official role (at this moment in time) with PASS.  I will still be giving back to the SQL Server community in 2015.  I plan on starting a local user group in South Houston.  I admit that I should have started this at least 6 months ago but I&#8217;ve put it off.  2015 will be the year the Houston area gets a second user group and if you want to attend or help, let me know!  In addition, I will be helping to host a SQL Saturday in Houston early next summer.  I will also commit now to making actual use of this SQL blog in 2015 instead of it being a landing page for what has to be the worlds largest amount of SPAM (thanks askimet!).  Whenever there is a discussion on PASS and its future, you can be sure that I will be involved in it on some level.  I hope to encourage others to volunteer as I have and foster a new group of leaders in the SQL Server community.</p>
<p>&nbsp;</p>
<p>Thanks again to everyone who participates  in the SQL Community, you all are really what its all about!</p>
]]></content:encoded>
					
					<wfw:commentRss>http://www.allenkinsel.com/archive/2014/12/t-sql-tuesday-giving-back-to-the-sql-community-in-2015/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
		<item>
		<title>I want to be on the PASS NomCom this year</title>
		<link>http://www.allenkinsel.com/archive/2014/06/i-want-to-be-on-the-pass-nomcom-this-year/</link>
					<comments>http://www.allenkinsel.com/archive/2014/06/i-want-to-be-on-the-pass-nomcom-this-year/#comments</comments>
		
		<dc:creator><![CDATA[Allen Kinsel]]></dc:creator>
		<pubDate>Thu, 05 Jun 2014 18:22:57 +0000</pubDate>
				<category><![CDATA[Ramblings]]></category>
		<category><![CDATA[SQLPASS]]></category>
		<category><![CDATA[Syndicated]]></category>
		<category><![CDATA[Volunteer]]></category>
		<guid isPermaLink="false">http://www.allenkinsel.com/?p=1449</guid>

					<description><![CDATA[I&#8217;m running for another PASS elected position &#160; This is a simple post to say that yes, you read the NomCom ballot correctly and YES, I&#8217;ve decided to run for the NomCom this year instead of the PASS Board of Directors.  After last year and only having 3 candidates for the NomCom it was quite [&#8230;]]]></description>
										<content:encoded><![CDATA[<h2>I&#8217;m running for another PASS elected position</h2>
<p>&nbsp;</p>
<p>This is a simple post to say that yes, you read the NomCom ballot correctly and YES, I&#8217;ve decided to run for the NomCom this year instead of the PASS Board of Directors.  After last year and only having 3 candidates for the NomCom it was quite refreshing to see 11 for this years NomCom!  I dont intend to spill much digital Ink about why you should vote for me since I spilled so much last year over the <a href="http://www.allenkinsel.com/pass-election/">Board of Directors election</a>.</p>
<p>&nbsp;</p>
<p>None of this is to say that I&#8217;m uninterested or don&#8217;t want to get elected but, I don&#8217;t agree with the concept of an extremely active campaign to win a seat on the NomCom.</p>
<p>&nbsp;</p>
<p>So, feel free to read more about me on the campaign site <a href="http://www.sqlpass.org/Elections/Candidates/Candidate1.aspx">here</a> or download my application <a href="http://www.sqlpass.org/Portals/0/elections/2014/2014%20PASS%20NomCom%20Application-AllenKinsel-Public.pdf">here</a> and most of all get out and vote!</p>
]]></content:encoded>
					
					<wfw:commentRss>http://www.allenkinsel.com/archive/2014/06/i-want-to-be-on-the-pass-nomcom-this-year/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Extending automation of SQL recoveries using Ola Hallengren&#8217;s backup solution</title>
		<link>http://www.allenkinsel.com/archive/2014/01/extending-automation-of-sql-recoveries-using-ola-hallengrens-backup-solution/</link>
		
		<dc:creator><![CDATA[Allen Kinsel]]></dc:creator>
		<pubDate>Tue, 14 Jan 2014 20:18:52 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Syndicated]]></category>
		<category><![CDATA[TSQLTuesday]]></category>
		<category><![CDATA[Automation]]></category>
		<category><![CDATA[Backups]]></category>
		<category><![CDATA[Recovery]]></category>
		<category><![CDATA[SQL]]></category>
		<guid isPermaLink="false">http://www.allenkinsel.com/?p=1441</guid>

					<description><![CDATA[“Automation is inherently good” This might be one of the only phrases you can get all DBA’s to agree on without that dreaded “it depends” that we DBA’s like to throw around so much. This months T-SQL Tuesday is about automation and I thought I’d write about extending existing automation.  One of my favorite scripts [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a href="http://sqlchow.files.wordpress.com/2013/01/tsql2sday.png?w=640" target="_blank"><img style="display: inline; float: right;" alt="" src="http://sqlchow.files.wordpress.com/2013/01/tsql2sday.png?w=640" align="right" /></a>“Automation is inherently good” This might be one of the only phrases you can get all DBA’s to agree on without that dreaded “it depends” that we DBA’s like to throw around so much.</p>
<p>This months <a href="http://sqlchow.wordpress.com/2014/01/07/t-sql-tuesday-050-automation-how-much-of-it-is-the-same/">T-SQL Tuesday is about automation</a> and I thought I’d write about extending existing automation.  One of my favorite scripts for automation is <a href="http://ola.hallengren.com/">Ola Hallengren’s Backup &amp; Maintenance solution</a>.  Ola’s scripts are a fantastic way to automate highly configurable backups and maintenance on your SQL Server instances.  If you’re not using them, you should seriously consider looking into why.</p>
<p>This solution serves as an outstanding base but like anything else its can be useful to tweak things a bit.  Extending the initial automation provided by his scripts is what this post is all about.</p>
<p>In particular, I’ve modified Ola’s scripts to generate the files needed to restore all of the databases that have been backed up with his solution.  In particular, having the ability to easily restore the whole server in the case of a disaster.  Though, you could easily pull out one DB to only restore it.  This script is currently only written for litespeed since that’s what I use for backups.  However, it could easily be changed to support native backups or any of the other backup products that Ola’s scripts can be configured for.  Perhaps Ill work on those in the future if it would be useful.</p>
<p>The idea is that every time you take a backup the backup job will create a .sql file on the server filesystem in the backup directory that can be used to restore to the point of the backups that were just taken.</p>
<p>This solution includes three pieces, an additional stored procedure, an additional step in both of the backup jobs to execute that stored procedure and lastly a step in the cleanup procedure to remove the restore scripts from the filesystem that have aged.</p>
<p>A couple of notes of caution:</p>
<blockquote>
<p>As with anything you find on the internet, please use at your own risk in a development/test system and proceed with caution.</p>
<p>This script makes several assumptions including</p>
<ul>
<li>That you’ve installed Ola’s commands into the master database</li>
<li>That you’re using litespeed</li>
<li>That logging to the commandlog table is enabled</li>
</ul>
</blockquote>
<p>The stored procedure is relatively simple and accepts a single parameter @type  “LOG” will generate the script as of the last log backup taken or for any other parameter, I happen to use “FULL”, it generates the script based on the last full backup.</p>
<pre class="csharpcode" style="width: 100%; height: 1117px;"><span class="kwrd">CREATE</span> <span class="kwrd">PROCEDURE</span> [dbo].[GenerateRestoreScript] (@type <span class="kwrd">NCHAR</span>(30) = <span class="str">'LOG'</span>)
<span class="kwrd">AS</span> 
<span class="kwrd">DECLARE</span> @ID <span class="kwrd">INT</span>
<span class="kwrd">DECLARE</span> @DB NVARCHAR(128)

<span class="kwrd">SET</span> NOCOUNT <span class="kwrd">ON</span>

<span class="kwrd">SELECT</span>  @ID = <span class="kwrd">MAX</span>(database_id)
<span class="kwrd">FROM</span>    sys.databases

<span class="kwrd">IF</span> @type = <span class="str">'LOG'</span> <span class="kwrd">SET</span> @type = <span class="str">'xp_backup_log'</span> <span class="kwrd">ELSE</span> <span class="kwrd">SET</span> @type = <span class="str">''</span>
<span style="color: #00ff00;">--</span><span style="color: #0000ff;">These intentionally <span class="kwrd">not</span> commented <span class="kwrd">in</span> the script <span class="kwrd">as</span> a precaution (to generate an error)</span>
        <span class="kwrd">SELECT</span> <span class="str">'ALERT-ALERT-ALERT-ALERT-ALERT-ALERT-ALERT-ALERT-ALERT-ALERT-ALERT-ALERT-ALERT-'</span>
        <span class="kwrd">SELECT</span> <span class="str">'PLEASE BACKUP THE TAIL OF THE LOG</span>
        <span class="kwrd">SELECT</span> <span class="str">'OTHERWISE THIS COULD BECOME A RGE (GOOGLE THE ACRONYM!)'</span>
        <span class="kwrd">SELECT</span> <span class="str">'IF YOU ARE OK REPLACING THE DB AND LOOSING DATA IN THE TAIL LOG RUN THIS SCRIPT WITHOUT THESE COMMENTS '</span>
        <span class="kwrd">SELECT</span> <span class="str">'RAISERROR(N'</span><span class="str">'ARE YOU SURE YOU WANT TO DO THIS?'</span><span class="str">', 25,1) WITH Log;'</span>      
        <span class="kwrd">SELECT</span> <span class="str">'--------'</span>

<span class="kwrd">WHILE</span> @ID &gt; 2
    <span class="kwrd">BEGIN</span>

        <span class="kwrd">SELECT</span>  @DB = NAME
        <span class="kwrd">FROM</span>    sys.databases
        <span class="kwrd">WHERE</span>   database_id = @ID

        <span class="kwrd">SELECT</span>  @ID = @ID - 1

        <span class="kwrd">SELECT</span> <span class="str">'----'</span> + @DB + <span class="str">'-----------------------------------------------------'</span>  

        <span class="kwrd">SELECT</span> <span class="str">'EXECUTE '</span> 
        + REPLACE(Command, <span class="str">'_backup_'</span>, <span class="str">'_restore_'</span>)
        + <span class="str">', @filenumber = 1, @with = N'</span><span class="str">''</span> 
        + <span class="kwrd">CASE</span> <span class="kwrd">WHEN</span> rn &lt;&gt; 1 <span class="kwrd">THEN</span> <span class="str">'NO'</span> <span class="kwrd">ELSE</span> <span class="str">''</span> <span class="kwrd">END</span> 
        +  <span class="str">'RECOVERY'</span><span class="str">''</span>
        + <span class="kwrd">CASE</span> <span class="kwrd">WHEN</span> CommandType = <span class="str">'xp_backup_database'</span> <span class="kwrd">THEN</span> <span class="str">', @with = N'</span><span class="str">'REPLACE'</span><span class="str">';'</span> <span class="kwrd">ELSE</span> <span class="str">';'</span> <span class="kwrd">END</span>

         <span class="kwrd">FROM</span> 
        (
        <span class="kwrd">SELECT</span> 
            <span class="kwrd">SUBSTRING</span>(<span class="kwrd">LEFT</span> (Command, CHARINDEX(<span class="str">''</span><span class="str">', @with ='</span>,Command)),CHARINDEX(<span class="str">'[master]'</span>,Command),LEN(Command)) <span class="kwrd">AS</span> Command
            , ROW_NUMBER() <span class="kwrd">OVER</span> (<span class="kwrd">ORDER</span> <span class="kwrd">BY</span> cl.ID <span class="kwrd">DESC</span>) <span class="kwrd">AS</span> rn
            , CommandType
        <span class="kwrd">FROM</span>    [master].[dbo].[CommandLog] cl
        <span class="kwrd">WHERE</span>   cl.DatabaseName = @DB
                <span class="kwrd">AND</span> (cl.CommandType = <span class="str">'xp_backup_database'</span> <span class="kwrd">OR</span> cl.CommandType = @type)

                <span class="kwrd">AND</span> cl.ID &gt;= ( <span class="kwrd">SELECT</span>   <span class="kwrd">MAX</span>(ID)
                               <span class="kwrd">FROM</span>     CommandLog c
                               <span class="kwrd">WHERE</span>    CommandType <span class="kwrd">IN</span> ( <span class="str">'xp_backup_database'</span> )
                                        <span class="kwrd">AND</span> cl.DatabaseName = c.DatabaseName
                             )
        ) <span class="kwrd">AS</span> rntab

        <span class="kwrd">ORDER</span> <span class="kwrd">BY</span> rn <span class="kwrd">DESC</span>                     

    <span class="kwrd">END</span></pre>
<p>To execute the stored procedure, this needs to be added as an additional cmdexec job step to the Full backup job (make sure to change the directory where you want the .sql files stored (H:\SERVERNAME below))</p>
<pre class="csharpcode" style="width: 100%; height: 48px;">sqlcmd -l 30 -E -S $(ESCAPE_SQUOTE(SRVR)) -d master -y 0 -b -Q "EXEC [dbo].[GenerateRestoreScript] ''FULL''" –o”H:\SERVERNAME\DRFULL_$(ESCAPE_SQUOTE(STRTDT))_$(ESCAPE_SQUOTE(STRTTM))_RESTORE.sql" –w50000</pre>
<p>To execute the stored procedure, this needs to be added as an additional cmdexec job step to the Transaction log backup job (make sure to change the directory where you want the .sql files stored (H:\SERVERNAME below))</p>
<pre class="csharpcode" style="width: 100%; height: 48px;">sqlcmd -E -S $(ESCAPE_SQUOTE(SRVR)) -d master -y 0 -b -Q "EXEC [dbo].[GenerateRestoreScript]" -o"H:\SERVERNAME\DRLOG_$(ESCAPE_SQUOTE(STRTDT))_$(ESCAPE_SQUOTE(STRTTM))_RESTORE.sql" –w50000</pre>
<style type="text/css"><!--
.csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; }
--></style>
<p>This cmdexec Job step that needs to be added to the output file cleanup job to clean up old .sql files (make sure to change the directory where the .sql files stored (H:\SERVERNAME below))</p>
<p>Note: currently this configuration keeps the files from the past 3 days but the actual files kept depends on when the cleanup job is scheduled.</p>
<pre class="csharpcode" style="width: 100%; height: 48px;">cmd /q /c "For /F "tokens=1 delims=" %v In (''ForFiles /P "H:\SERVERNAME" /m *RESTORE.sql /d -3 2^<span class="kwrd">&gt;</span>^&amp;1'') do if EXIST "H:\SERVERNAME"\%v echo del "H:\SERVERNAME"\%v&amp; del "H:\SERVERNAME"\%v"</pre>
<style type="text/css"><!--
.csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; }
--></style>
<p>I have these steps scripted into Ola’s original solution .sql so the folder names are set properly and job creation is completely automated.  Ill leave that part of extending automation to you, dear reader, as homework.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Finding impersonation info in SQL Server</title>
		<link>http://www.allenkinsel.com/archive/2013/12/finding-impersonation-info-in-sql-server/</link>
		
		<dc:creator><![CDATA[Allen Kinsel]]></dc:creator>
		<pubDate>Thu, 12 Dec 2013 14:50:00 +0000</pubDate>
				<category><![CDATA[Bits N Bytes]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Syndicated]]></category>
		<category><![CDATA[SQL]]></category>
		<guid isPermaLink="false">http://www.allenkinsel.com/?p=1436</guid>

					<description><![CDATA[Since SQL Server 2005 we’ve been able to grant one login the ability to impersonate another in order to have a different set of effective permissions.  More than a few times I’ve found this paradigm useful in order to solve problems while adhering to the principal of least privilege and likewise more than a few [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Since SQL Server 2005 we’ve been able to grant one login the ability to <a href="http://msdn.microsoft.com/en-us/library/ms181362(v=sql.110).aspx" target="_blank">impersonate</a> another in order to have a different set of effective permissions.  More than a few times I’ve found this paradigm useful in order to solve problems while adhering to the <a href="http://en.wikipedia.org/wiki/Principle_of_least_privilege">principal of least privilege</a> and likewise more than a few times I&#8217;ve tried to find information about who has impersonation privileges in SSMS and have been severely disappointed to find that it is buried.  This extremely simple script solves that problem and gives all of the information about who has impersonation rights on an instance.</p>
<p>&nbsp;</p>
<p>If you want to read more about all the fantastic things you can do with EXECUTE AS and impersonation, <a href="http://technet.microsoft.com/en-us/library/ms188304(v=sql.105).aspx">MSDN</a> is a good place to start</p>
<pre class="csharpcode"><span class="kwrd">SELECT</span>  grantee_principal.name <span class="kwrd">AS</span> WhoCanImpersonate ,
        grantee_principal.type_desc <span class="kwrd">AS</span> ImpersonatorType ,
        sp.name <span class="kwrd">AS</span> WhoCanTheyImpersonate ,
        sp.type_desc <span class="kwrd">AS</span> ImpersonateeLoginType

<span class="kwrd">FROM</span>    sys.server_permissions <span class="kwrd">AS</span> prmssn
        <span class="kwrd">INNER</span> <span class="kwrd">JOIN</span> sys.server_principals <span class="kwrd">AS</span> sp
            <span class="kwrd">ON</span> sp.principal_id = prmssn.major_id
               <span class="kwrd">AND</span> prmssn.<span class="kwrd">class</span> = 101
        <span class="kwrd">INNER</span> <span class="kwrd">JOIN</span> sys.server_principals <span class="kwrd">AS</span> grantee_principal
            <span class="kwrd">ON</span> grantee_principal.principal_id = prmssn.grantee_principal_id
<span class="kwrd">WHERE</span>   prmssn.<span class="kwrd">state</span> = <span class="str">'G'</span></pre>
<style type="text/css"><!--
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
--></style>
<style type="text/css"><!--
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
--></style>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>The Community Has Spoken</title>
		<link>http://www.allenkinsel.com/archive/2013/10/the-community-has-spoken/</link>
					<comments>http://www.allenkinsel.com/archive/2013/10/the-community-has-spoken/#comments</comments>
		
		<dc:creator><![CDATA[Allen Kinsel]]></dc:creator>
		<pubDate>Wed, 02 Oct 2013 17:34:37 +0000</pubDate>
				<category><![CDATA[Ramblings]]></category>
		<category><![CDATA[SQLPASS]]></category>
		<guid isPermaLink="false">http://www.allenkinsel.com/?p=1417</guid>

					<description><![CDATA[This years election results are officially in the books.  Unfortunately I&#8217;ve come up four votes short in my effort to be elected. I&#8217;d like to congratulate the winners, I&#8217;m sure y&#8217;all will do great things.  Dont worry, we&#8217;ll all be watching to see you make good on those campaign promises! I&#8217;d also like to thank all of [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>This years election results are officially in the <a href="http://www.sqlpass.org/Elections.aspx">books</a>.  Unfortunately I&#8217;ve come up four votes short in my effort to be elected.</p>
<p>I&#8217;d like to congratulate the winners, I&#8217;m sure y&#8217;all will do great things.  Dont worry, we&#8217;ll all be watching to see you make good on those campaign promises!</p>
<p>I&#8217;d also like to thank all of my supporters, <a href="http://www.allenkinsel.com/pass-election/">public</a> and private.  Your words helped me more than you&#8217;ll likely ever know.</p>
<p><a href="http://sqlandy.com">Andy Warren</a> in particular was abolutely critical in helping me strategize through this years campaign.  I wouldn&#8217;t have made it this far without his support and encouragement over the years.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>http://www.allenkinsel.com/archive/2013/10/the-community-has-spoken/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>Wrapping up my campaign</title>
		<link>http://www.allenkinsel.com/archive/2013/09/wrapping-up-my-campaign/</link>
		
		<dc:creator><![CDATA[Allen Kinsel]]></dc:creator>
		<pubDate>Mon, 30 Sep 2013 13:00:09 +0000</pubDate>
				<category><![CDATA[SQLPASS]]></category>
		<category><![CDATA[Syndicated]]></category>
		<category><![CDATA[Volunteer]]></category>
		<guid isPermaLink="false">http://www.allenkinsel.com/?p=1404</guid>

					<description><![CDATA[According to the published timelinethe 2013 iteration of the PASS Board elections will be over in just a few hours.  As I wrap up this year’s campaign I wanted to send out a huge thank you to the SQL community members who have supported me in my endeavor to have a second term on the Board.  [&#8230;]]]></description>
										<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.allenkinsel.com/wp-content/uploads/2010/08/Vote.jpg"><img loading="lazy" class="size-medium wp-image-456 aligncenter" alt="Just do it!" src="http://www.allenkinsel.com/wp-content/uploads/2010/08/Vote-300x161.jpg" width="300" height="161" srcset="http://www.allenkinsel.com/wp-content/uploads/2010/08/Vote-300x161.jpg 300w, http://www.allenkinsel.com/wp-content/uploads/2010/08/Vote.jpg 500w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p style="text-align: left;">According to the published <a href="http://www.sqlpass.org/Elections/Timeline.aspx">timeline</a>the 2013 iteration of the PASS Board elections will be over in just a few<a href="http://www.timeanddate.com/worldclock/fixedtime.html?msg=PASS+Board+of+Directors+Voting+Ends&amp;iso=20130930T12&amp;p1=137"> hours</a>.  As I wrap up this year’s campaign I wanted to send out a huge thank you to the SQL community members who have <a href="http://www.allenkinsel.com/pass-election/endorsements/">supported</a> me in my endeavor to have a second term on the Board.  I am humbled to have such a great and supporting group of friends and colleagues.</p>
<p style="text-align: left;">I hope that my writings have proven helpful by detailing my visions for PASS and that you have already chosen to select my name on the ballot.  However, if you haven’t voted yet, or just haven’t seen enough of my ideas for making PASS a better place, please check out my <a href="http://www.allenkinsel.com/pass-election/">elections page</a> for plenty more information.</p>
<p>I’m Allen Kinsel, I hope you’ll vote for me and I approve this message</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Being a Better Director if Reelected</title>
		<link>http://www.allenkinsel.com/archive/2013/09/being-a-better-director-if-reelected/</link>
		
		<dc:creator><![CDATA[Allen Kinsel]]></dc:creator>
		<pubDate>Fri, 27 Sep 2013 16:52:41 +0000</pubDate>
				<category><![CDATA[SQLPASS]]></category>
		<category><![CDATA[Syndicated]]></category>
		<guid isPermaLink="false">http://www.allenkinsel.com/?p=1396</guid>

					<description><![CDATA[Happily, It’s Friday and as I was looking at all the digital bits I’ve spilled in this campaign, I realized there was one more topic I wanted to draw your quick attention to: Things I want to do better this time I need to remember that communication is key and telling you what I ‘m [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Happily, It’s Friday and as I was looking at all the <a href="http://www.allenkinsel.com/pass-election/">digital bits I’ve spilled in this campaign</a>, I realized there was one more topic I wanted to draw your quick attention to: Things I want to do better this time</p>
<ul>
<li>I need to remember that communication is key and <i>telling you</i> what I ‘m working on is at least as important as what I’m working on.  In my first term, particularly towards the end, I sometimes sacrificed communication in order to get something done.  You need to see what I’m doing (or not doing) and be able to give feedback if you think I’ve headed in the wrong direction.</li>
</ul>
<ul>
<li>I want to get back to doing a better job of utilizing volunteers.  Aligning work and volunteers is hard.  As anyone who has lead a chapter, a SQLSaturday or any kind of volunteer effort know, it often feels easier and faster to just do things than to delegate things.  I had good success with delegation in the program committee and am prepared to return to a similar model during this term.  My success should not be measured by how much I do personally but rather by how much gets done within my portfolio.</li>
</ul>
<ul>
<li>I want to think “International” every time I start on something new.  Not because it’s the cool community buzzword but because I want PASS to serve everyone and I know I <i>don’t</i> have enough experience to know what will or won’t work in other countries.</li>
</ul>
<p>That’s it for the week.  Thanks for reading and thanks for voting!  Have a great weekend!</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>My PASS Network</title>
		<link>http://www.allenkinsel.com/archive/2013/09/my-pass-network/</link>
		
		<dc:creator><![CDATA[Allen Kinsel]]></dc:creator>
		<pubDate>Thu, 26 Sep 2013 17:51:13 +0000</pubDate>
				<category><![CDATA[SQLPASS]]></category>
		<category><![CDATA[Syndicated]]></category>
		<category><![CDATA[Volunteer]]></category>
		<guid isPermaLink="false">http://www.allenkinsel.com/?p=1388</guid>

					<description><![CDATA[When I started volunteering for PASS nine years ago I was focused on contributing and helping where I could. I met a few people, volunteered some more, met a few more people, and somehow before I knew it I was serving on the PASS Board.  I learned a lot, tried to help people where I [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>When I started volunteering for PASS nine years ago I was focused on contributing and helping where I could. I met a few people, volunteered some more, met a few more people, and somehow before I knew it I was serving on the PASS Board.  I learned a lot, tried to help people where I could, had a lot of fun and without thinking about it much at all, had built a network</p>
<p>Once I had decided to run for the board again I decided to ask my network, the people I’ve worked with, for their help in my campaign.  I asked for help reviewing my application, for help preparing for the NomCom interview, and I asked, awkwardly and reluctantly, for their public endorsements.  I am lucky enough to have had many of them answer my call for help and I am humbled by what many of them have said publicly about my efforts and PASSion for PASS.  It would be impossible for me to say that I’m not thrilled in getting these pillars of our communities support for my campaign but the reality is I am equally as happy to know that each of them have recognized the work and effort I’ve put forth for PASS over the years.</p>
<p>Here are a few hand selected quotes from my supporters writings <img src="https://s.w.org/images/core/emoji/14.0.0/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>Karen Lopez:</p>
<blockquote><p>“Allen Kinsel should be your very first vote for the PASS Board. His passion for the community and chapters is perfect. In fact, he continued his volunteering and continued to work on Board-level projects during his brief time off the Board”</p></blockquote>
<p>Andy Warren</p>
<blockquote><p>“We were colleagues for a year during his first term on the Board and I found him to be hard working, thoughtful, and always willing to listen to other points of view &#8211; exactly the qualities a Board member needs!”</p></blockquote>
<p>Andy Leonard</p>
<blockquote><p>“Allen has a good sense of the inner workings of the PASS Board. He brings extensive experience with the SQL Server Community, as well.  I think both are important, and that’s why I’m voting for Allen.”</p></blockquote>
<p>Tom Larock</p>
<blockquote><p>“Allen Kinsel&#8217;s dedication and passion for the members of the PASS Community is second to none.”</p></blockquote>
<p>Grant Fritchey</p>
<blockquote><p>“I absolutely believe that Allen has the best interests of this organization at heart. He wants to make a difference for the better. More than that, I’ve seen him working as a volunteer within the organization where he does make a difference, does make things better. He brings passion to the job.”</p></blockquote>
<p>Allen White</p>
<blockquote><p>“as head of the Chapter program has helped countless user group chapters come into being and thrive. I think this success warrants a return to the board.”</p></blockquote>
<p>&nbsp;</p>
<p>Rob Farley</p>
<blockquote><p>“There are few people who can influence PASS like Allen Kinsel. The impact that he while had on the board before was nothing short of remarkable. I&#8217;ll be voting for Allen because I know he will serve the community wholeheartedly, throwing his all behind making the SQL community stronger.”</p></blockquote>
<p>Jeremiah Peschka</p>
<blockquote><p>“Allen is hard working, thoughtful, and dedicated to making PASS a great organization for the members”</p></blockquote>
<p>Brian Kelley</p>
<blockquote><p>“Allen knows how to do the job, can do the job, has the experience for the job, and the passion for the job. I can&#8217;t say that about any other candidate, as good as they are. That&#8217;s a key reason Allen stands out to me”</p></blockquote>
<p>Wayne Snyder</p>
<blockquote><p>“There are a couple of things I look for in a Board Member for PASS. Long Term Committment to the community and to PASS, whatever you promise &#8211; you must deliver, demonstrated ability to work with and motivate other community leaders, and PASSion. Allen has shown all of these traits during his long experience with our organization and our volunteers and will make an excellent Board Member.”</p></blockquote>
<p>Aaron Bertrand</p>
<blockquote><p>“I&#8217;ve known Allen for several years and I&#8217;ve always admired and respected the passion and dedication he has for the community.”</p></blockquote>
<p>Patrick LeBlanc</p>
<blockquote><p>&#8220;The thing that stands out the most is his passion and commitment to PASS and the SQL Server community as a whole”</p></blockquote>
<p>Tim Mitchell</p>
<blockquote><p>“He is a shoot-straight Texan who is not afraid to speak up even if what he has to say is unpopular”</p></blockquote>
<p>Jack Corbett</p>
<blockquote><p>“More was accomplished for local groups in Allen&#8217;s time leading that portfolio than in any other time period during my involvement with PASS. Allen&#8217;s passion for the PASS mission to Connect, Share, and Learn drives him to cut through the red-tape and get things done”</p></blockquote>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Dividing The Effort Pie</title>
		<link>http://www.allenkinsel.com/archive/2013/09/dividing-the-effort-pie/</link>
		
		<dc:creator><![CDATA[Allen Kinsel]]></dc:creator>
		<pubDate>Wed, 25 Sep 2013 16:30:44 +0000</pubDate>
				<category><![CDATA[SQLPASS]]></category>
		<category><![CDATA[Syndicated]]></category>
		<category><![CDATA[Volunteer]]></category>
		<guid isPermaLink="false">http://www.allenkinsel.com/?p=1379</guid>

					<description><![CDATA[During my earlier term on the Board I struggled to keep up with all of the opportunities that came along to contribute.  I had projects within my portfolio I wanted to get chartered, projects in other portfolios that interested me, and plenty of intra-Board discussions where participation is vital. It’s was incredibly easy to find myself [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>During my earlier term on the Board I struggled to keep up with all of the opportunities that came along to contribute.  I had projects within my portfolio I wanted to get chartered, projects in other portfolios that interested me, and plenty of intra-Board discussions where participation is vital. It’s was incredibly <strong>easy</strong> to find myself working 15 hours a week or more on top of my day job.  It’s absolutely about time management, but also about making some decisions about what you care about most. The method I found that worked for me before and that I plan to use again is to look at every task and map it into one of the three key areas (AKA:  slices of pie).  Let me walk you through what those look like.</p>
<h2>Tactical portfolio level</h2>
<p>This is what I like to call immediate term work.  Typically when joining the Board a Director is assigned a portfolio, given some resources and tasked with being its steward.  Depending on the portfolio and its current state this can either be a huge assignment or a rather minor one.  As a new director it’s very easy to get sucked in to spending all of your time working on things in this area.  While this is admirable, the problem is the organization still has needs in the other areas, particularly the longer term vision.</p>
<h2>General PASS Improvements</h2>
<p>Things I group into this area are generally not immediate term but, closer to short/middle term.   When I group things in to this category, they are typically things PASS is looking to do within the next year or two and have a limited longer term impact on the organization.  I would include things in this group like approving a budget, deciding to have a second Business Analytics Conference, or whether there should be a SQL Rally in a certain location.</p>
<h2>Board &amp; Governance issues</h2>
<p>This is the last major category of time I use.  It’s easily overlooked and critically important to the long term viability of the organization.  Governance is typically boring and filled with minutiae but it is absolutely critical for a Board member to continue to look into the future and make decisions now that put the organization in a favorable position.  During my previous tenure on the board global growth, business analytics strategy and restrictions on company BOD representation fell into this category</p>
<h2>Summary</h2>
<p>I know that if I’m elected I won’t be able to do it all. I’m going to have to make choices and I’ll make the choices that I think serve PASS over the long(er) term.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
