tag:blogger.com,1999:blog-71779729536896190142024-02-20T20:39:39.464-05:00Brian's Ramblings on SQL ServerBrian Davishttp://www.blogger.com/profile/09717680497151708747noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-7177972953689619014.post-72744246087644367482011-04-26T08:35:00.000-04:002011-04-26T08:35:24.642-04:00Tech Content Has MovedI am excited to announce that my technical content has been moved to <a href="http://lessthandot.com/">LessThanDot</a>. From now on all my SQL & tech related posts will be there. I'm still planning on keeping this blog around for the short tech history and continuing with blogs about life, running, and other stuff.<br />
Please take a minute to update your feeds:<br />
While you can subscribe to just my posts at LessThanDot I suggest you subscribe to the main feed for even more great posts...<br />
My Posts Only: <a href="http://blogs.lessthandot.com/index.php/All/?tempskin=_rss2&author=638">Link</a><br />
Main LessThanDot Feed: <a href="http://www.lessthandot.com/rss.php">Link</a>Brian Davishttp://www.blogger.com/profile/09717680497151708747noreply@blogger.com0tag:blogger.com,1999:blog-7177972953689619014.post-15941365344326770102011-03-10T15:10:00.000-05:002011-03-10T15:10:21.349-05:00Giving Back: Speaking, Blogging, & Community Involvement<div style="margin-bottom: .0001pt; margin: 0in;"><span style="color: black;">I've always said that I wouldn't be where I am today without the generous help and encouragement of the SQL Server Community and that is absolutely true. It's also true that I wouldn't be continuing to grow and learn as quickly as I am without the continued support of the community. While I've taken a lot from the community, I believe it's past time for me to start giving back as much as I can. I've always tried to do my part to help those physically around me, but I never felt I was at a level to give back to the community at large. I was wrong and I thank those around me who have never stopped encouraging and pushing me.<o:p></o:p></span></div><div style="margin-bottom: .0001pt; margin: 0in;"><br />
</div><div style="margin-bottom: .0001pt; margin: 0in;"><b><span style="color: black;">There Are So Many Opportunities To Give Back</span></b><span style="color: black;"><o:p></o:p></span></div><div style="margin-bottom: .0001pt; margin: 0in;"><span style="color: black;">Here's a few ideas to get you started thinking about how you can to give back to the community. You don't have to do them all, pick one that sounds interesting and start with that. <o:p></o:p></span></div><ul type="disc"><li class="MsoNormal" style="color: black; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;">Join a Local User Group<o:p></o:p></li>
<ul type="circle"><li class="MsoNormal" style="color: black; mso-list: l0 level2 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 1.0in;">To find one in your area check out the<span class="apple-converted-space"> </span><a href="http://www.sqlpass.org/PASSChapters.aspx">PASS Chapters Page</a><o:p></o:p></li>
<li class="MsoNormal" style="color: black; mso-list: l0 level2 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 1.0in;">Also take a look at the<span class="apple-converted-space"> </span><a href="http://www.sqlpass.org/Community/VirtualChapters.aspx">Virtual Chapters</a><span class="apple-converted-space"> </span>that are available<o:p></o:p></li>
</ul><li class="MsoNormal" style="color: black; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;">Forums<o:p></o:p></li>
<ul type="circle"><li class="MsoNormal" style="color: black; mso-list: l0 level2 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 1.0in;">Read and help answer questions in forums<o:p></o:p></li>
<li class="MsoNormal" style="color: black; mso-list: l0 level2 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 1.0in;"><a href="http://www.sqlservercentral.com/Forums/">SQL Server Central</a>,<span class="apple-converted-space"> </span><a href="http://www.sqlteam.com/forums/">SQL Team</a>,<span class="apple-converted-space"> </span><a href="http://stackoverflow.com/">StackOverflow</a><o:p></o:p></li>
</ul><li class="MsoNormal" style="color: black; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;">Blog - Start a blog and write about your experiences and interests<o:p></o:p></li>
<ul type="circle"><li class="MsoNormal" style="color: black; mso-list: l0 level2 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 1.0in;">Brent Ozar (<a href="http://www.brentozar.com/">blog</a><span class="apple-converted-space"> </span>|<span class="apple-converted-space"> </span><a href="http://twitter.com/#!/brento">twitter</a>) has a great blog series on<span class="apple-converted-space"> </span><a href="http://www.brentozar.com/archive/2008/12/how-to-start-a-technical-blog/">Starting a Technical Blog</a><o:p></o:p></li>
</ul><li class="MsoNormal" style="color: black; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;">Start Speaking<o:p></o:p></li>
<ul type="circle"><li class="MsoNormal" style="color: black; mso-list: l0 level2 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 1.0in;">Choose a topic that you are interested in, passionate about, or want to learn about<o:p></o:p></li>
<li class="MsoNormal" style="color: black; mso-list: l0 level2 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 1.0in;">This ties in great with blog posts<o:p></o:p></li>
</ul><li class="MsoNormal" style="color: black; mso-list: l0 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;">Twitter<o:p></o:p></li>
<ul type="circle"><li class="MsoNormal" style="color: black; mso-list: l0 level2 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 1.0in;">Join and start following those in the SQL Community<o:p></o:p></li>
<li class="MsoNormal" style="color: black; mso-list: l0 level2 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 1.0in;">Follow the<span class="apple-converted-space"> </span><a href="http://twitter.com/#search?q=%23SQLHelp">#SQLHelp</a><span class="apple-converted-space"> </span>hash tag<o:p></o:p></li>
<li class="MsoNormal" style="color: black; mso-list: l0 level2 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 1.0in;">If you don't have the first clue about Twitter, check out<span class="apple-converted-space"> </span><a href="http://www.brentozar.com/twitter/book/">Brent's Twitter Book</a><o:p></o:p></li>
</ul></ul><div style="margin-bottom: .0001pt; margin: 0in;"><span style="color: black;">Don't be afraid, whatever you decide to do. You don't have to know everything or be "an expert" to participate and give back to the community. Just remember to be kind and not be rude. The SQL Community is very welcoming, appreciative and helpful. There will be times when you will be wrong and that's OK. Learn from your mistakes and move on. <o:p></o:p></span></div><div style="margin-bottom: .0001pt; margin: 0in;"><br />
</div><div style="margin-bottom: .0001pt; margin: 0in;"><span style="color: black;">If you decide you want to present, pick a topic that interests you. Case in point, after being asked to co-present a session at the<span class="apple-converted-space"> </span><a href="http://ohionorthsqlserverug.org/">ONSSUG</a><span class="apple-converted-space"> </span>on Source Control for DBA's, I decided I wanted to continue speaking (ok, maybe there was a little prodding from Allen White (<a href="http://sqlblog.com/blogs/allen_white/default.aspx">blog</a><span class="apple-converted-space"> </span>|<span class="apple-converted-space"> </span><a href="http://twitter.com/#!/sqlrunr">twitter</a>) which I truly thank him for) but I really did want to continue presenting because I enjoyed it. I knew I wanted to present but I wasn't sure what topic to pick. Then I saw that someone posted a session request for Service Broker for<span class="apple-converted-space"> </span><a href="http://sqlsaturday.com/60/schedule.aspx">SQL Saturday #60</a>. I thought, "I've always wanted to learn more about Service Broker" and now was a good chance. I started learning Service Broker, working with it and building a presentation. It took a lot of work but I enjoyed every minute of it. I submitted the session for SQL Saturday #60 and it was accepted. I'll admit, it was a little nerve racking giving my first solo presentation at a SQL Saturday but it was a great experience and I wouldn't trade it for anything. The session received good reviews and I was pleased for my first presentation. I would however suggest, that if you are thinking about starting to present you start with a local user group or even peers from your company. Then move up to a<span class="apple-converted-space"> </span><a href="http://sqlsaturday.com/default.aspx">SQL Saturday</a>, followed by<span class="apple-converted-space"> </span><a href="http://www.sqlpass.org/sqlrally/2011/orlando/">SQL Rally</a><span class="apple-converted-space"> </span>and then onto the<span class="apple-converted-space"> </span><a href="http://www.sqlpass.org/summit/2011/">SQL PASS Summit</a><span class="apple-converted-space"> </span>or<span class="apple-converted-space"> </span><a href="http://sqlconnections.com/">SQL Connections</a>. When you are presenting there will be times where someone will ask a question you don't know the answer to and that's OK. Be honest, tell them you don't know, but also let them know that you will look into it and get back to them. You can let them know via an email or better yet, tell them to watch your blog and write about it. Again, the point is you don't have to know everything there is to know about a subject to present and to give back to the community. Talk about what you know and learn what you don't that interests you. If you find a topic interesting your presentations will be that much more interesting to the audience.<o:p></o:p></span></div><div style="margin-bottom: .0001pt; margin: 0in;"><br />
</div><div style="margin-bottom: .0001pt; margin: 0in;"><span style="color: black;">The same goes for blogging, write about what interests you and your experiences. Just because someone already blogged about a topic doesn't mean you can't. Make the topic your own by including personal experiences or situations and how you dealt with them. If you reference someone else's material or blog be sure to give credit to them and link to the material. Whatever you do, don't use someone else's material as your own. <o:p></o:p></span></div><div style="margin-bottom: .0001pt; margin: 0in;"><br />
</div><div style="margin-bottom: .0001pt; margin: 0in;"><b><span style="color: black;">Balance Your Time</span></b><span style="color: black;"><o:p></o:p></span></div><div style="margin-bottom: .0001pt; margin: 0in;"><span style="color: black;">Whatever you decide to do, make sure you balance your time. It's easy to get sucked in and spend a lot of time on whatever it is you are doing. Don't burn yourself out in a short period of time. Make sure you leave time for yourself and your family. Having a wife and two young boys (ages 6 & 3) myself, I know it's not easy to try to fit everything in and find a good balance, I'm still working on it. Set some time aside specifically for doing whatever it is you choose to do and stick to it as best as possible. It's a balancing act that will be forever changing as your life and interests change but it's possible to do it. Remember you don't have to do everything all at once. Some things make sense to do together, some don't. Look around, check out your options and choose what works for you. <o:p></o:p></span></div><div style="margin-bottom: .0001pt; margin: 0in;"><br />
</div><div style="margin-bottom: .0001pt; margin: 0in;"><b><span style="color: black;">What Am I Doing?</span></b><span style="color: black;"><o:p></o:p></span></div><div style="margin-bottom: .0001pt; margin: 0in;"><span class="apple-style-span"><span style="color: black;">Personally, I started by getting involved with my local user group, <a href="http://ohionorthsqlserverug.org/">ONSSUG</a>, which lead me into starting this blog and presenting. Eventually, I'd love to become more active on some of the forums but for now that is waiting until I become more comfortable with my current routine. This blog isn't where I want it to be yet, but I'm working on it and it will get there. As I said earlier, I'm also presenting at user groups and SQL Saturdays. Check out my</span></span><span class="apple-converted-space"><span style="color: black;"> </span></span><span class="apple-style-span"><span style="color: black;"><a href="http://briandavis78.blogspot.com/p/events.html">Events</a></span></span><span class="apple-converted-space"><span style="color: black;"> </span></span><span class="apple-style-span"><span style="color: black;">page to see where I'll be presenting. If you're there, stop by and say 'Hi', I'd love to meet you.</span></span><span style="color: black;"><o:p></o:p></span></div><div style="margin-bottom: .0001pt; margin: 0in;"><br />
</div><div style="margin-bottom: .0001pt; margin: 0in;"><b><span style="color: black;">My Thank You's</span></b><span style="color: black;"><o:p></o:p></span></div><div style="margin-bottom: .0001pt; margin: 0in;"><span style="color: black;">To the SQL Community as whole, I say thank you from the bottom of my heart for being so open, welcoming and encouraging to myself and everyone else. This community is truly the best!<o:p></o:p></span></div><div style="margin-bottom: .0001pt; margin: 0in;"><span style="color: black;">There are a few people that I need to personally thank for their efforts in bringing me out of my "offline shell"...<o:p></o:p></span></div><div style="margin-bottom: .0001pt; margin: 0in;"><br />
</div><div style="margin-bottom: .0001pt; margin: 0in;"><span style="color: black;">First, to Allen White (<a href="http://sqlblog.com/blogs/allen_white/default.aspx">blog</a> | <a href="http://twitter.com/#!/sqlrunr">twitter</a>), thank you, I couldn't have done all this without you. Thank you for welcoming me into the user group and getting me involved. You are and continue to be a great guide and mentor. <o:p></o:p></span></div><div style="margin-bottom: .0001pt; margin: 0in;"><br />
</div><div style="margin-bottom: .0001pt; margin: 0in;"><span style="color: black;">Secondly, to Sarah Dutkiewicz (<a href="http://codinggeekette.com/">blog</a><span class="apple-converted-space"> </span>|<span class="apple-converted-space"> </span><a href="http://twitter.com/#!/sadukie">twitter</a>) who was one of the first people I met at the first user group meeting I attended and who has continually encouraged me and provided great insights. She was also kind enough to give me one of the MSDN subscriptions she </span><span style="color: black;">received </span><span style="color: black;">for being awarded her MVP status. I can't thank you enough.<o:p></o:p></span></div><div style="margin-bottom: .0001pt; margin: 0in;"><br />
</div><div style="margin-bottom: .0001pt; margin: 0in;"><span style="color: black;">To Brent Ozar (<a href="http://www.brentozar.com/">blog</a> | <a href="http://twitter.com/#!/brento">twitter</a>) & Tom LaRock (<a href="http://thomaslarock.com/">blog</a><span class="apple-converted-space"> </span>|<span class="apple-converted-space"> </span><a href="http://twitter.com/#!/sqlrockstar">twitter</a>), thank you for inspiring me to blog and always being willing to talk, listen, & offer advice to not only myself but anyone in the community! I met both of you at my first PASS Summit in 2009 and that was where I first learned how truly wonderful the SQL Community is. It took a couple of years but I finally got my blog up and running.<o:p></o:p></span></div><div style="margin-bottom: .0001pt; margin: 0in;"><br />
</div><div style="margin-bottom: .0001pt; margin: 0in;"><span style="color: black;">To Paul Randal (<a href="http://sqlskills.com/blogs/paul/">blog</a><span class="apple-converted-space"> </span>|<span class="apple-converted-space"> </span><a href="http://twitter.com/#!/paulrandal">twitter</a>) & Kimberly Tripp (<a href="http://sqlskills.com/blogs/kimberly/">blog</a><span class="apple-converted-space"> </span>|<span class="apple-converted-space"> </span><a href="http://twitter.com/#!/KimberlyLTripp">twitter</a>), thank you for everything you do and the knowledge you share. My first experience with the SQL community and conferences was sitting in one of your pre-cons at SQL Connections in 2007. I was amazed and inspired at your dedication and willingness to talk to and help anyone who came your way.<o:p></o:p></span></div><div style="margin-bottom: .0001pt; margin: 0in;"><br />
</div><div style="margin-bottom: .0001pt; margin: 0in;"><b><span style="color: black;">Summing It All Up</span></b><span style="color: black;"><o:p></o:p></span></div><div style="margin-bottom: .0001pt; margin: 0in;"><span style="color: black;">Give back to the community in any way you can. Help make it even better and more amazing than it already is. You don't have to be an expert to do any of this, you simply need to have the interest and desire to participate, learn and share your experiences with others. The SQL Community is great because so many people want to learn and help others learn what they already know!</span></div>Brian Davishttp://www.blogger.com/profile/09717680497151708747noreply@blogger.com2tag:blogger.com,1999:blog-7177972953689619014.post-18461989266476391942011-02-14T20:59:00.000-05:002011-02-14T20:59:49.756-05:00Trevor: Best Wishes From ClevelandHi Trevor,<br />
We are no place exotic, but we are thinking of you and wishing you a speedy recovery.<br />
Here's a picture of us in our backyard in Cleveland, Ohio.<br />
<div class="separator" style="clear: both; text-align: left;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxM60CtBp3FekjT5Uyn1_u-AjxRKjCq5gRw4DwADVO8dAaH3puD7uJVc10Ufvf79tEgFLQsFsMPNGscgg_KKHIL5lKiilFEoY8WQB3COvytoblJFrYQwDNCX5h1ZmOnodlcGi6BXL0KPU/s1600/Well+Wishes+Trevor.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="219" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxM60CtBp3FekjT5Uyn1_u-AjxRKjCq5gRw4DwADVO8dAaH3puD7uJVc10Ufvf79tEgFLQsFsMPNGscgg_KKHIL5lKiilFEoY8WQB3COvytoblJFrYQwDNCX5h1ZmOnodlcGi6BXL0KPU/s320/Well+Wishes+Trevor.jpg" width="320" /></a></div>(Brian, Jenn, Tyler, Nate)<br />
<br />
And another, warmer picture, from Devil's Lake, Michigan.<br />
<div class="separator" style="clear: both; text-align: left;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhR9AFVkb-vfw-2zwyRZOifiXl4ga6TE_PxHRod4vwLLUfUSOL44y1WBJzDxdHI1_SQ5ZnhfQZCcx41T8sa1o_iNclQUGMUWWwKzI0t4FM9A-MxwBHsUz9yg9TMbdnilGTYlGQFwXwthYE/s1600/IMG_0084.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhR9AFVkb-vfw-2zwyRZOifiXl4ga6TE_PxHRod4vwLLUfUSOL44y1WBJzDxdHI1_SQ5ZnhfQZCcx41T8sa1o_iNclQUGMUWWwKzI0t4FM9A-MxwBHsUz9yg9TMbdnilGTYlGQFwXwthYE/s320/IMG_0084.JPG" width="320" /></a></div><br />
Hoping you feel better soon!<br />
The Davis FamilyBrian Davishttp://www.blogger.com/profile/09717680497151708747noreply@blogger.com0tag:blogger.com,1999:blog-7177972953689619014.post-6510339558949430842011-02-08T18:32:00.008-05:002011-02-09T14:40:11.989-05:00TSQL Tuesday #15: Automation<center><a href="http://sqlasylum.wordpress.com/2011/02/01/invitation-to-t-sql-tuesday-15-automation-in-sql-server/"><img border="0" height="150" src="http://photo.blogpressapp.com/photos/11/02/01/s_988.jpg" style="margin-bottom: 5px; margin-left: 5px; margin-right: 5px; margin-top: 5px;" width="150" /></a></center><br />
Now that I've started blogging I decided to throw my hat into the ring for TSQL Tuesday, hosted this month by Pat Wright aka SQLAsylum (<a href="http://sqlasylum.wordpress.com/" target="_blank">Blog</a> | <a href="http://twitter.com/#!/sqlasylum">Twitter</a><a href="http://twitter.com/SQLAsylum" target="_blank"></a>) and the topic is Automation.<br />
<br />
Recently, I needed to compile a listing of all the accounts that were running all of the SQL Server services in the environment. After throwing the manual option out the window and looking at a few other options I decided that PowerShell would provide the best solution. In my environment I have dedicated database that houses information I've collected about all of the servers. One of the tables just happens to contain a list of servers. Using PowerShell I'll scan through the list of servers and then run a WMI query against each to get the accounts for each SQL service on the server. Once I have the accounts and their associated services I then upload that information to a table in my database. From there the data can be exported or displayed via SSRS.<br />
<br />
The code is pretty well documented so let's take a look at the script (download link at end of post).<br />
<br />
# =======================================================================<br />
# SCRIPT BODY<br />
# =======================================================================<br />
#Initialize the SQL Environment<br />
.\Initialize-SqlpsEnvironment.ps1<br />
<br />
#Define Counter Variables<br />
[int]$count=0<br />
[int]$total=0<br />
<br />
#Define the destination server and database names<br />
$sqlsrv = "SQLSrv01"<br />
$destdb = "SvcDB"<br />
<br />
#Clean out the SvcInfo Table<br />
$q = "delete LoadSvcInfo"<br />
$reslist = invoke-sqlcmd -ServerInstance $sqlsrv -Database $destdb -Query $q<br />
Write-Host "Clean SvcInfo Table"<br />
<br />
#Define the list server and database<br />
$listsrv = "SQLSrv01"<br />
$listdb = "ServerDB"<br />
<br />
#Get server list<br />
$q = "select distinct servername from ServerList order by servername"<br />
$reslist = invoke-sqlcmd -ServerInstance $listsrv -Database $listdb -Query $q<br />
$total = $reslist.length<br />
foreach ($strSrv in $reslist){<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>#Increment Counter<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$count++<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>#Display current server & count<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>Write-Host "Server: " $strSrv.ServerName " " $count " of " $total<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>#$m = New-Object ('Microsoft.SqlServer.Management.Smo.WMI.ManagedComputer') $strSrv.ServerName<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>#Get Service Account Info<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$colItems = gwmi win32_service -computer $strSrv.ServerName -property name, startname, caption | where {$_.Name -like "*SQL*"}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>foreach($objItem in $colItems) {<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>#Send info to our database<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$q = "insert [SvcDB].[dbo].[SvcInfo] (SrvName, SvcName, SvcCaption, SvcAcct) Values ("<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$q = $q + "'" + [string]$strSrv.ServerName + "', "<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$q = $q + "'" + [string]$objItem.name + "', "<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$q = $q + "'" + [string]$objItem.caption + "', "<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$q = $q + "'" + [string]$objItem.startname + "')"<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$res = invoke-sqlcmd -ServerInstance $sqlsrv -Database $destdb -Query $q<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$colItems = gwmi win32_service -computer $strSrv.ServerName -property name, startname, caption | where {$_.Name -like "MSDTSServer*"}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>foreach($objItem in $colItems) {<br />
<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>#Send info to our database<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$q = "insert [SvcDB].[dbo].[SvcInfo] (SrvName, SvcName, SvcCaption, SvcAcct) Values ("<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$q = $q + "'" + [string]$strSrv.ServerName + "', "<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$q = $q + "'" + [string]$objItem.name + "', "<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$q = $q + "'" + [string]$objItem.caption + "', "<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$q = $q + "'" + [string]$objItem.startname + "')"<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>$res = invoke-sqlcmd -ServerInstance $sqlsrv -Database $destdb -Query $q<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>}<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>#$m = $null<br />
}<br />
Write-Host "DONE!"<br />
#=======================================================================<br />
# END OF SCRIPT: [ServiceAccounts]<br />
#=======================================================================<br />
<br />
<a href="https://docs.google.com/uc?id=0B46NFrojVG66ZWNjNzVkYmYtNTZiNy00YTExLTkzNjAtN2Q2ZTYxNWMxYTAz&export=download&authkey=CL-rlv4F&hl=en">Download Zip of ServiceAccounts Script</a>Brian Davishttp://www.blogger.com/profile/09717680497151708747noreply@blogger.com0tag:blogger.com,1999:blog-7177972953689619014.post-41584314536596782862011-01-29T23:58:00.001-05:002011-03-05T19:50:43.153-05:00SQL Saturday #60 - 2 Firsts in 1 Day<div class="separator" style="clear: both; text-align: center;"><a href="http://sqlsaturday.com/60/eventhome.aspx"><img border="0" height="128" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiA5N4ngeXFAbZ60LwlEuWiaK3Kg8bcYNM8eDKyhWgHioriUXZM70iRuyvMQGvk29tk_VZOJNSBujCnFjoOo2rozfEeppJxEhC8Xpp8zANg6q5TnlVwzkHs07QnV0eZhes5KaYezvkkoNw/s320/sqlsat60_print.png" width="320" /></a></div><div class="separator" style="clear: both; text-align: left;"><a href="http://sqlsaturday.com/60/eventhome.aspx"></a>This coming Saturday (2/5/2011) the SQL user group I am a part of, <a href="http://ohionorthsqlserverug.org/">Ohio North SQL Server User Group</a>, will be hosting its' first <a href="http://sqlsaturday.com/60/eventhome.aspx">SQL Saturday #60</a>. It's been a lot of fun helping to organize what I know will be a great event. We've got speakers coming from all over along with many great local speakers and the <a href="http://sqlsaturday.com/60/schedule.aspx">session lineup</a> is amazing. If a day of free SQL Server training from some outstanding speakers isn't enough to get you to come to Cleveland in February, check out the Allen White's (<a href="http://sqlblog.com/blogs/allen_white">Blog</a> | <a href="http://twitter.com/#!/sqlrunr">Twitter</a>) <a href="http://sqlblog.com/blogs/allen_white/archive/2010/09/12/sql-saturday-60-cleveland-ohio.aspx">Top Ten Reasons to Come to Cleveland in February</a>. If that wasn't enough we also have a great after party planned at <a href="http://wingzsportsgrill.com/">Wingz</a> followed by SQL Karaoke at <a href="http://www.grillerspub.com/">Grillers Pub</a>. Come join us for a great day of SQL Server, networking, and a lot of fun!</div><div class="separator" style="clear: both; text-align: left;"><br />
</div><div class="separator" style="clear: both; text-align: left;">On a personal note, SQL Saturday #60 will be special for me for two reasons. First, it will be the first SQL Saturday I've attended. Second, it will be my first time presenting. I'm presenting <a href="http://sqlsaturday.com/viewsession.aspx?sat=60&sessionid=3106">"Service Broker...What's That & How Do I Use It"</a>. This will be a beginner level session where will take a look at what Service Broker is and how it works. I'll walk through the setup and configuration along with some usage examples. I'm really looking forward to presenting and getting my first presentation under my belt. Hope to see you at SQL Saturday #60.</div><div class="separator" style="clear: both; text-align: left;"><br />
</div>Brian Davishttp://www.blogger.com/profile/09717680497151708747noreply@blogger.com0tag:blogger.com,1999:blog-7177972953689619014.post-77319452001118815462011-01-24T10:00:00.017-05:002011-01-24T10:13:50.110-05:00SQL Server Separation of Duties Framework 2.0 Released!<span class="Apple-style-span" style="font-family: inherit;">Last November at PASS I attended a session entitled</span> "<span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: 13px; font-weight: bold;">Si Se Puede! Achieving Separation of Duties with SQL Server</span><span class="Apple-style-span" style="font-family: Tahoma, Arial, Helvetica; font-size: x-small;">" </span><span class="Apple-style-span" style="font-family: inherit;">presented by Il-Sung Lee and Lara Rubbelke (<a href="http://sqlblog.com/blogs/lara_rubbelke/default.aspx">blog</a> | <a href="http://twitter.com/SQLGal">twitter</a>). Lara and Il-Sung discussed the separation of duties between the DBA and the sysadmin role and presented the <a href="http://sqlserversod.codeplex.com/">SQL Server Separation of Duties Framework</a> to help facilitate this.</span><br />
<span class="Apple-style-span" style="font-family: inherit;"><a href="http://sqlserversod.codeplex.com/releases/view/59675">Version 2.0 of the Separation of Duties Framework</a> has just been released and it can help you create a controlled environment to manage permissions for various levels of DBA's and/or users.</span><br />
<br />
<span class="Apple-style-span" style="font-family: inherit;">Do you ever need to grant a user specific elevated permissions? </span><br />
<span class="Apple-style-span" style="font-family: inherit;">What about granting some junior level DBA's the ability to unlock a login but not the ability to alter it?</span><br />
<br />
<span class="Apple-style-span" style="font-family: inherit;"></span>Using the SoD Framework you can setup multiple roles with specific permissions and assign users to them as necessary. This framework can help accomplish these tasks easily and in a controlled environment. It's completely user definable and as of this release is capable of handling multiple tiers of users. Check out<br />
<span class="Apple-style-span" style="font-family: inherit;">Lara's <a href="http://sqlblog.com/blogs/lara_rubbelke/archive/2011/01/23/you-want-to-grant-someone-permissions-to-do-what.aspx">latest blog post</a> for more information. </span>Check it out and leave us a comment if you have any questions or issues.<br />
<br />
<span class="Apple-style-span" style="font-family: inherit;">It's been a great experience working with Lara Rubbelke (<a href="http://sqlblog.com/blogs/lara_rubbelke/default.aspx">blog</a> | <a href="http://twitter.com/SQLGal">twitter</a>) on version 2.0 of this framework and we are looking forward to continuing the development of this project.</span>Brian Davishttp://www.blogger.com/profile/09717680497151708747noreply@blogger.com0tag:blogger.com,1999:blog-7177972953689619014.post-52707077162012966222011-01-17T21:55:00.053-05:002011-01-23T20:03:34.055-05:00New Year, New Resolutions<b>It's a new year...</b><div><ul><li>I'll be married for 9 years in April</li>
<li>My oldest son will be 7 in November</li>
<li>My youngest son will be 4 in July</li>
<li>I'll be speaking at my first SQL Saturday in February (<a href="http://sqlsaturday.com/60/eventhome.aspx">SQL Saturday #60 in Cleveland</a>) and hopefully more afterwards</li>
<li>I'll have been at my current job for 4 years in September</li>
</ul><div><b>New Resolutions</b></div></div><div>With a new year comes new resolutions. In the past I haven't always stuck to my resolutions but this year, more than any other, I plan to. These resolutions are important me and will help get me to where I think I want to be in life, so this year, more than any other in the past, I plan to accomplish them. So, without further to do, in no particular order, here are my resolutions for 2011.</div><div><ul><li>Blog at lest once a month</li>
<li>Get out and run at least twice a week</li>
<li>Contribute as much as I can back to the SQL community that has given me so much</li>
<li>Continue to be involved with the <a href="http://ohionorth.sqlpass.org/">Ohio North SQL Server User's Group</a></li>
<li>Be involved in my kids lives and have fun with them</li>
</ul><div>Even though it's a bit late, Happy New Year to all. I hope you have a great year!</div></div>Brian Davishttp://www.blogger.com/profile/09717680497151708747noreply@blogger.com0tag:blogger.com,1999:blog-7177972953689619014.post-29656507505427496362011-01-02T20:56:00.002-05:002011-01-23T20:04:03.657-05:00Hello Blogosphere - Who I am & Why I'm Here<strong>Short BIO</strong><br />
My name is Brian Davis and I've been in the IT field for almost 15 years. I started as a developer working with FoxPro 2.6 for DOS/VFP 6/VB6, moving up through VFP7/8/9. In 2003 the company I worked for asked me if I'd be interested in doing double duty as a developer and DBA. I said yes and started working with SQL Server 2000 and never looked back. Since then I've changed companies and became a full time database analyst. I'm currently one of a handful of DBA's responsible for maintaining servers running everything from SQL 2000 to 2008R2. I've also become involved with the SQL User Group here in Cleveland, OH.<br />
<br />
<strong>Why Blog?</strong><br />
After being inspired by many people in the SQL Server community I've decided to start writing my own blog. I've found more helpful tips and tricks than I can remember from blogs written by generous members of the SQL community. My hope is that by blogging about my own experiences that I will be able to give something back to community that has helped me so much.<br />
<br />
<strong>What to Expect Here?</strong><br />
My plan is to post about my experiences with SQL Server. The pitfalls I encounter and the lessons I learn, along with any scripts/code that I've created or found useful. I've already got a few blog posts lined up and will be working on them in the days and weeks ahead. Along with that I've also been working on a plug-in for SSMS that I am planning to release.<br />
<br />
<strong>Thank You!</strong><br />
Finally, I want to say thank you to the SQL community for all the support and information you've shared with me. Without the community I wouldn't be where I am today.Brian Davishttp://www.blogger.com/profile/09717680497151708747noreply@blogger.com0