SQLvariations: SQL Server, a little PowerShell, maybe some Hyper-V Rotating Header Image

SQL Server

I Will Be Speaking at the 2010 PASS Summit

PASS Summit Email Signature

I just wanted to take a quick moment to let everyone know that yesterday I received the great news that I will be speaking about PowerShell at the 2010 PASS Summit:-)   Here’s what my session will be:

The Dirty Dozen: PowerShell Scripts for the Busy DBA

You’ve heard it said, “If you have to do it twice, automate it.” That’s great advice and PowerShell provides a simple but extremely powerful way to do it. PowerShell is the future of Windows scripting. Cut the learning curve and get a real handle on this powerful automation tool. This session walks you through a dozen scripts to simplify and easily automate time-consuming and tedious elements of your day to day job. This isn’t stuff you’ll use SOMEDAY, these are scripts you can use when you get home tonight.  Harness the power of PowerShell to easily find Servers short on space. Script out tables and constraints across all of your databases at once. Backup databases and restore them to a different environment. These tricks and many others will allow PowerShell to simplify your job like no other tool.

Speaker:

Aaron Nelson
Senior Database Administrator

I owe a huge thanks to everyone who helped me make this a reality and I’ll write a post thanking many of them when I get some time.

Early May PASS VC Presentations

Next week is the 24 Hours of SQL Server 2008 R2 PASS but before we get there the Virtual Chapters of PASS have some free training on tap for us:

pass_logo
_____________________________________________________________

“You Got XML In My Database? What’s Up With That?”
May 11th 12:00 PM EDT (GMT -4)
Add to Calendar
Presenter: Stuart Ainsworth

A brief presentation exploring the marriage of XML and relational databases, including when it works and when it doesn’t. Coverage will include various use case scenarios, and some tips on how to improve performance using design techniques.

Stuart Ainsworth:

Stuart I Ainsworth, MA, Med is a Database Architect working in the realm of Financial Information Security; over the last 15 years, he’s worked as a Research Analyst, a report writer, a DBA, a programmer, and a public speaking professor. He’s one of the chapter leaders for AtlantaMDF, the Atlanta chapter of PASS. A master of air guitar, he has yet to understand the point of Rock Band (“You push buttons? What’s that all about?”).

How do I view the presentation?
Attendee URL:  Live Meeting link
_____________________________________________________________

Indexing Guidelines
May 12, 2010 Noon Mountain Time (-6 GMT)
Presenter: Greg Larsen

This session will discuss indexing guidelines. During this discussion there will be information about how developers and DBA’s should approach the indexing development lifecycle. This lifecycle will help attendees understand that you shouldn’t just develop some indexes while you are developing your applications and then forget about them. In addition some indexing guidelines will be discussed. These guidelines will help you make better choices on which columns to select for your indexes and how those columns should be ordered in multi-column indexes. There will be number of demonstrations to support this discussion. Lastly an indexing toolkit (a set of scripts) that you can use to help manage your indexes will be provided.

Greg Larsen:

Greg Larsen has been working with SQL Server since 1999. He has authored over 125 articles related to SQL Server. He holds a MCITP Database Administrator and Developer certification for SQL Server 2005 and is a SQL Server MVP. Greg also hosts the www.sqlserverexamples.com website which contains a number of T-SQL examples to help you manage your SQL Server environment and application T-SQL code. Greg has a full-time DBA gig, but also provides SQL Server consulting services in his spare time.


Door Prize: There will be a drawing for a $50.00 Amazon Gift Certificate
Registration: You can attend the meeting without registering but if you want to be entered in the drawing, you must register at https://www.livemeeting.com/lrs/8000181573/Registration.aspx?pageName=jhh2nc28185sd034 no later than 5:00 PM Eastern on May 11th.

Live Meeting Link: https://www.livemeeting.com/cc/usergroups/join?id=CPN75W&role=attend

_____________________________________________________________

12 Key Development Areas
May 13th 1:00 PM EDT (GMT -4)
Presenter: Andy Warren

A good professional development plan has to go far beyond ‘learning more technology’, it has to encompass the wide variety of skills you need to build the next step in your career, and it has to include a variety of learning methods. We’ll discuss how much time and money you should budget when building your plan, and how the distribution of time and money changes as your career evolves. We’ll look at the growth phases you’ll encounter, learning how you learn best, how to keep up with new technology without burning out, and even how things like blogging and Twitter can be an interesting part of your plan.

Andy Warren
Andy Warren (@SQLAndy) is a SQL trainer focusing on basic administration and performance tuning, he runs the free SQLShare.com training site, is currently a SQL Server MVP, blogs daily at SQLAndy.com, started the SQLSaturday franchise,  is co-President of the Orlando SQL Server Users Group, serves as a member of the Board of Directors of PASS, and was a founding partner in SQLServerCentral.com.  In his remaining free time he’s working on a book for first time managers and squeezes in some woodworking for relaxation.

Live Meeting Link: https://www323.livemeeting.com/cc/usergroups/join?id=5233Z9&role=attend

_____________________________________________________________

Extract, Transform, and Load your Data Warehouse
May 14, 2010 12:00 PM EDT (GMT -4) Add to calendar
Presenter: Jessica M. Moss

One data warehouse buzzword that often gets used is “ETL”, also known as extract, transform, and load.  But what does this really mean from a data warehousing perspective and how do we use SQL Server Integration Services to perform these ETL functions?  This session will answer these questions and show solutions to common ETL problems.

Jessica M. Moss

Jessica M. Moss, an architect with Ironworks Consulting and a Microsoft SQL Server MVP, is a well-known practitioner, author, and speaker in Microsoft SQL Server business intelligence.  Jessica has created numerous data warehousing solutions for companies in the retail, internet, health services, finance, and energy industries and authored technical content for multiple magazines, websites, and the book “Microsoft SQL Server 2008 Integration Services Problem-Design-Solution”.  Jessica enjoys working with the central Virginia community and speaks regularly at user groups, code camps, and conferences.  You can read about her work on her blog, http://www.jessicammoss.com.

Live Meeting Link: https://www.livemeeting.com/cc/usergroups/join?id=CPPC3S&role=attend

_____________________________________________________________

Picking up a New Hammer

The other day I was answering a question in the forums on PowerGUI.org that I thought would be a quick answer. The only problem was that I had my T-SQL hammer in my hand and not my PowerShell hammer. When I read the question I thought of a way to solve the problem using T-SQL and PowerShell; the only problem was I didn’t think outside of this toolset. PowerShell MVP Shay Levy ( blog | twitter ) chimed in with a much better answer.

PoSh

Now granted I usually prefer to give answers that your typical data professionals will be comfortable with, ones that pass along a query, but in this case I have to go with the solution that you might not be as comfortable with. There’s a good reason though: It’s faster.

here was my answer:
#Only load this part once when you open up your PowerShell Session
add-pssnapin SqlServerCmdletSnapin100
add-pssnapin SqlServerProviderSnapin100            

#Create a text file in your c:\temp\ directory called AllServers.txt
#Put each server\instance on a new line.
foreach ($svr in get-content "C:\temp\AllServers.txt")             

{
#sp_databases | format-table
invoke-sqlcmd -query "SELECT @@SERVERNAME AS 'ServerName', @@VERSION AS 'SQL Version'" -database master -serverinstance $svr >> "c:\temp\MySQLServerVersions.txt"
}
and here was Shay’s answer:
$null = [System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.SMO')            

Get-Content Allservers.txt | Foreach-Object {
   $sql= New-Object Microsoft.SqlServer.Management.Smo.Server $_
   $sql | Select-Object @{n='ServerName';e={$sql.name}},@{n='Version';e={$sql.version}}
}

Without a doubt Shay’s answer is better because it returned the same results in a better format AND ran in a quarter of the time of my answer. In my environment my solution took a respectable 60 milliseconds to run, Shay’s answer using the SMO took 15 milliseconds. What’s my point today? The SMO is worth learning because it can be faster.�
Where can you learn the SMO? I’m glad you asked :-) Take a look at this MSDN article by SMO expert Allen White ( blog | twitter )

del.icio.us Tags: ,,