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

April, 2010:

I’ll be speaking at CodeStock!

I’ll have more info for you guys later but this will be my first non-SQL-centric event that I will be speaking at so I just wanted to share  I’m extra-excited about this event because this year they are making a push for Women In Technology.  Here’s a snippet from that announcement: “This year we are hoping to aid in raising awareness for women in technology.  The US Department of Labor reported in 2009 women made up only 22.9% of computer programmers, and just 20.9% of computer software engineers.  For comparison, women chief executives counted for 23.4% – more women are CEOs than programmers!  (As an aside, 79.2% of meeting and convention planners are women, I’m a rarity it seems.) This problem isn’t a simple one, and it not going to be fixed by a clever logo, but we can help by raising awareness.” Here’s some more info on the event: The theme for CodeStock 2010 is about connections.  Connecting with peers and building a professional network.  Connecting with IT roles outside of your own.  Connecting with the people who can help make your ideas reality. Keynote by Microsoft Developer Evangelist Rachel Appel Sessions for Developers, IT Professionals, and Entrepreneurs 100+ break out sessions + Open Spaces (self-organizing sessions) Panel discussions and live podcasts CodeStock Social Event to meet and make connections Space is limited so register today at CodeStock.org LiveJournal Tags: PowerShell,SQL Server 2008,WIT,Speaking At

Atlanta PowerShell User Group April Meeting

Please come join us for our second meeting   I will be as well as several PowerShell experts.  When: Tomorrow Tuesday April 20, 2010 at 6 pm Where: 211 Perimeter Center Parkway, Suite 200, Atlanta, GA 30346 How: Please RSVP so we can get a head count What:  People from all over Atlanta getting together to talk PowerShell What is a script club you ask? You bring an idea for a script, and ask your fellow PowerShell users for help getting the script written. If it’s PowerShell, its covered — just bear in mind that it may be hard to test things like Exchange scripts, Active Directory, or SQL Server management scripts unless you have a nice virtual lab on your laptop. What are the Rules of Script Club? You always talk about script club You always talk about script club If someone asks for help, and you can help, you help Two people help one person at one time One module per person per night All scripts, all PowerShell Scripts will be as short as they can be If this is your first time at Script Club, You have to script! Please RSVP so we can get a head count. Our meeting is graciously sponsored by PowerShellCommunity.org. LiveJournal Tags: PowerShell,Atlanta,User Group

T-SQL Tuesday #005 – Reporting – The Round-Up

Well I’d say this T-SQL Tuesday was a success.  33 people contributed blogs; and two people ended up with two different posts they wanted to submit.  I would have had this round-up out sooner but trying to read 33 blog posts after work is a little much and terribly fun at the same time.  The fact that I kept stopping to try out what I had just read also hindered my progress. If you read through all of these posts and aren’t inspired to go create some report that you’ve been meaning to get around to I don’t know what will ever inspire you.  I’m going to summarize them in the order they were received. Rob Farley shows us some new features that involve easy mapping in SQL Server 2008 R2 with Report Builder 3.0.  VERY COOL! Michael Coles Was part of the reason this was taking so long.  STOP what you are doing and DO THIS!! Brad Schulz Well I’m not sure who Ella Vader is but I sure agree with the sentiment about the airlines.  Continuing with the ‘Holy Crap I’ve got to try that!’ theme that we’ve got going is a way to build org-charts or any other type of hierarchy you need. David Gardiner points us to some useful posts on Microsoft Report Viewer 2010.  Damn handy of him. Pinal Dave steps us through with screenshots how to configure a Management Data Warehouse.  Stef Bauer shows us an easy way to setup an HTML table for presenting a cleaner list of events in an email. Barnaby Self doesn’t want to go off on a rant or anything but would like to show us how to build a report using an MDX query (which I didn’t know is something that you can’t do straight out of the box). Gethyn Ellis Goes into a more advanced version of something that I touched on in my post.  It’s important to off load your reporting to a different server.  If you don’t the next thing that you will hear is that your organization wants to store everything in XML.  Jes Borland gives us a method to use when you need to find out what your business needs when building a new report.  If you don’t already have one yourself, print this out and pin it to your cube wall. (Oh and use it!) Jason Strate steps us through how to create a Wait Stat report and even gives us the code!! Dave Levy Shows us how to take the dashboard inside of SSMS and give it to anyone that doesn’t have SSMS installed but wants to know why the server is slow.  I will be getting up from my desk now to go show a couple of sysadmins how to do this! Nicolas Cain gives us an explanation on row versioning.  I will be pointing a few of the developers I work with at this post.  If that doesn’t get them to stop putting WITH (NOLOCK) in their queries I’m just going to find myself a lead pipe (Just kidding, I do not condone work place violence unless it involves the physical safety of the data; and even then I don’t have to worry about it, that’s why our security guards carry guns.) Stephen Spanos shows us how to create an updateable report. Jack Corbett Keeps us from looking like fools by showing us how to prevent emailing a report that is blank.  Why has no one ever told me how to do this before?!  Thanks Jack!! Pat Wright Shows us how to work with vertical tables.  You need to take a look at this.  I don’t know if this is allowed but I asked for a follow-up post because this one hits really close to home on something that I’m working on right now. Seth Phelabaum Saw into the future came through with something that we’re all going to need after we get inspired and setup a bunch of the reports that these people have showed us are so easy to do.    A way to report on your reports. Chad Miller shows us how to use PowerShell to report on the connection strings inside of your SSIS packages. Robert Davis Points out a feature bug of running SSRS 2008 with smart card login on Windows 2008*.  This is not the first time I have seen a bug reported about SSRS causing problems with things that seem completely unrelated so I guess I will just take comfort that the SSRS really like the concept of securing every angle. Sankar Reddy Answers a freaking excellent question: Who put my database offline?  He tells us about an undocumented feature fn_dblog that lets us know changes that have been going on with our db.  I’m definitely going to spend some time Michael Swart takes us back to that subject brought up by Jes Borland about gathering requirements and encourages us to be the user. Paul Randal shows us that we can query internal objects in one database that doesn’t have the functionality we need from another database that does have the functionality that we do need.  Mike Walsh who hosted last month (and I wish would have warned me just how much reading I was in for!) shows us a feature that I had no idea was in SQL Sentry.  It actually reports database growth for you now.  I use SQL Sentry about 3 times a week and man I’m starting to feel like I need a full day class on all of the new features they’ve packed into this new version. Kalen Delaney tells us some history info on the COMPUTE BY clause which I didn’t know was being removed.  I have some ways I wish they would improve it instead of removing it and Adam Machanic tells me ‘COMPUTE BY has been replaced by a feature called Grouping Sets – Grouping Sets produces a single result, with NULLs in place of the values for columns that are being grouped’… but I digress back to Kalen’s terrific post.  If you’ve ever tried to explain how a cube works to someone that understands relational data but doesn’t understand dimensional data you’re in luck because she has included a diagram that can really help Mark Blakey takes us back to the topic of MDX in SSRS reports and shares a rule with us “Rule 1 – Never trust the automatically generated hidden datasets”.  Adam Machanic the founder of this little shindig answers the question “Why is Adam wasting my time with this garbage?”  He also walks us through some common problems that arise with purely technical reports.  In many of the places that I have worked no one has taken the time to solve these problems.  Well at least now I have somewhere to point them to. Jorge Segarra shows us how to gets some nice reports out of a SQL Server 2008 feature called Policy Based Management. Jason Brimhall who technically did two posts on this topic – shows us how he answered the question “why my primary file group was still so large after moving all of the User objects out of that filegroup and into new filegroups?”  I actually posed a very similar question to Paul Randal during the BOF lunch at the 2009 PASS Summit.  Maybe I should finally get around to blogging everything I wrote down from his answer. Andre Kamman steps us through how to create an index like you find in the back of a book.  Then he take it further and teaches us how to make it look good. Gabriel Villa Shows us how to set parameters in SSRS. Adam Haines shows us how to create and email HTML reports. Stacia Misner shares with us some observation about new properties and globals that you can find in the upcoming release of Reporting Services including PageName, ResetPageNumber, Globals!PageName & Globals!PageNumber, Globals!OverallPageNumber and Globals!OverallTotalPages. Steve Jones walks us through his solution to one of the most common problems I run into when automating reports.  Two people running the same report at different times and getting different answers. Aaron Nelson and finally I give some insight into a better way to allow desktop gadgets (and other reports) to report off of your production sales data.  I then walk you through how to create a desktop gadget using a third party tool. Since this topic was Reporting I thought I’d point out that a free e-book has been release for SQL Server 2008 R2 and Chapter 9 is on Reporting Services.  You’ll probably recognize that one of the names on that book is one of the bloggers that joined us in this round of T-SQL Tuesday.  You can read more about the book here. That’ wraps up the wrap-up.  If there’s something that I missed or a better summary that I could use please let me know. Oh, and some advice to future hosts.  Consider taking a half-day off. LiveJournal Tags: SQL Server,T-SQL,Reporting,#TSQL2sDay

Get-Sales | Out-Map = T-SQL Tuesday #005 – Reporting

For this month’s T-SQL Tuesday I thought I’d go with something useful that I’ve been meaning to blog about for weeks now.  While listening to the PowerScripting Podcast a few month’s back I heard about a product that sounded really cool for simple data visualization and quickly showing people just how powerful PowerShell is.  Now to get this to work using all the code on the screen you’ll at least have to download the trial version of of the Power Gadgets however even without the method I describe is important if you’re new to this type of reporting (desktop gadgets). Turns out this little piece of software had even more packed into it than I was hoping for.  I needed a piece of software that could allow me to pipe data to it to display it in a desktop gadget as a list. Before I show you how to setup this quick-and-easy tool to create desktop gadgets I want to issue a warning against setting up this type of thing directly against your production database; read all the way through or don’t blame me when you bring your production environment down. What you want to do (at the very least) is to have all of the gadgets that you deploy read from a central location where they only have to scoop up the results of the query that you’re trying to report on, and not 400 gadgets running the query itself.  An easy way to accomplish this would be to run the query in an Agent Job against your production environment (assuming that you don’t have a live reporting copy) and deposit those results in a table.  Let’s see if we can step through an example with the AdventureWorks database. If this below were your query to show your sales for today… SELECT SUM(SOD.OrderQty) AS ‘OrderQty‘, s.StateProvinceCode   FROM Sales.SalesOrderHeader SOH  INNER JOIN Sales.SalesOrderDetail SOD     ON SOH.SalesOrderID = SOD.SalesOrderID   JOIN Production.Product P     ON SOD.ProductID = P.ProductID   JOIN Person.Address A     ON SOH.BillToAddressID = A.AddressID   JOIN Person.StateProvince S     ON A.StateProvinceID = S.StateProvinceID  WHERE SOH.OrderDate = ’2001-07-01 00:00:00.000′ –<—This would get GETDATE() or something  GROUP BY S.StateProvinceCode …you would really want to create an Agent Job to load that into a table and select off of the table.  For simplicity we’ll leave out the job and just use the queries. /* <Do this part only one time>*/ USE [AdventureWorks] GO CREATE SCHEMA [Report] AUTHORIZATION [dbo] GO CREATE TABLE [Report].[TodaysSalesOrderByState]( [OrderQty] [int] NULL, [StateProvinceCode] [nchar](3) NOT NULL, [LastLoadTime] DATETIME NOT NULL CONSTRAINT [DF_LastLoadTime] DEFAULT GETDATE() ) ON [PRIMARY] /* </Do this part only one time>*/ Then this… /* <This is the part that would eventually go into an agent job, along with a delete statement before it that was in the same transaction>*/  INSERT INTO Report.TodaysSalesOrderByState ( [OrderQty], [StateProvinceCode]) SELECT SUM(SOD.OrderQty) AS ‘OrderQty‘, s.StateProvinceCode   FROM Sales.SalesOrderHeader SOH  INNER JOIN Sales.SalesOrderDetail SOD     ON SOH.SalesOrderID = SOD.SalesOrderID   JOIN Production.Product P     ON SOD.ProductID = P.ProductID   JOIN Person.Address A     ON SOH.BillToAddressID = A.AddressID   JOIN Person.StateProvince S     ON A.StateProvinceID = S.StateProvinceID  WHERE SOH.OrderDate = ’2001-07-01 00:00:00.000′ –<—This would get GETDATE() or something  GROUP BY S.StateProvinceCode /* </This is the part that would eventually go into an agent job>*/ Now you’ll want to create a stored proc that will be used to call the report data.  It will also make creating the report nice and clean. CREATE PROCEDURE [dbo].[rp_MapThat] AS  SELECT [OrderQty]       ,[StateProvinceCode] AS ‘State’   FROM [AdventureWorks].[Report].[TodaysSalesOrderByState] GO After that all you have to do is to go ahead and create the gadget using this little script: #Go ahead and add the SQL Snapins add-pssnapin SqlServerCmdletSnapin100 add-pssnapin SqlServerProviderSnapin100 #add the Gadgets Snapin add-pssnapin PowerGadgets invoke-sqlcmd -query “EXEC dbo.rp_MapThat” -database AdventureWorks -serverinstance WIN7\KILIMANJARO | out-map -values OrderQty -label State -title “CountByState” -refresh 0:1:0   And now you’ve got a gadget prototype.  I’m sure you can figure out how to turn it into an operational gadget for your company.     LiveJournal Tags: T-SQL

Speaking in Chicago this weekend at SQL Saturday #31

I’ll be speaking at SQL Saturday #31 in Chicago this weekend. I’m presenting a PowerShell for Data Professionals session.  This is based off a previous session but does include some new content.  If you’ve seen the session before, there will be something new and the demos will hopefully transition a little smoother.  I’m working with PowerShell automation every day at work and am still discovering new tricks and finding new targets for automation. Here are some details on the session: The first time that I saw PowerShell I hated it.  I thought it was complicated and stupid.  After trying a couple of scripts I gave up on PowerShell.  Then Windows 7 (and it’s nice script editor) was released and a light went on.  My session takes you through Power Shell basics and then I put it in action automating tasks DBAs do daily and showing you how to check servers for some common worst practices. There are a lot of excellent speakers at this SQL Saturday. I hope to see you there. Start Time     Track 1     Track 3     Track 4     Track 2     08:30 AM     SQLSaturday Chicago Welcome and Keynote                       09:00 AM     Jeremiah Peschka A Dynamic World Demands Dynamic SQL     Tim Ford SQL DMVs, DMFs, DMOs. WTH?     David Levy Getting Out from Behind the Curtain – The New DBA           10:00 AM     Kevin Kline TBD     Brent Ozar Perfmon & Profiler 101     Jorge Segarra SQL University 201: More DBA Fun     Wes Dumey Building a Data Warehouse using SQL Server 2008     11:00 AM     Kevin Kline Stored Procedure Best Practices     Aaron Nelson PowerShell for Data Professionals*     Ross LoForte Proactive DBA: Manage SQL Server Better           12:00 PM     SQLSaturday Chicago Vendor Session A                       12:30 PM     SQLSaturday Chicago Vendor Session B                       01:00 PM     Brent Ozar BLITZ! 60 Minute Server Takeovers     Jason Strate Using XML to Query Execution Plans     Tim Ford Tools for The Driven, But Lazy DBA           02:00 PM     Chuck Heinzelman Michael Steineke Oh Cluster, My Cluster!     Jason Strate Extended Events, Work Smarter Not Harder     Jorge Segarra Policy Based Management 101     Adam Jorgensen Zero to Cube in 60 Minutes     03:00 PM     Brad McGehee How and When to Use Indexed Views     Dean Richards Wait-Time Based Performance Management     Jeremiah Peschka Fundamentals of SQL Server Internals     Andrew Karcher One Developers Journey into MDX     04:00 PM     Brad McGehee Introduction to Graphical Execution Plans     Derek Comingore Delivering Rapid Business Value with Microsoft BI     Arie Jones Working with Spatial Data in SQL Server 2008     Devin Knight Analysis Services Partitions and Aggregations     05:00 PM     Alex Kuznetsov Defensive programming with Transact SQL     Arie Jones Reporting Services 2008 Unleashed!     Aaron King The Benefits of SQL Azure           06:00 PM     SQLSaturday Chicago Ask the Experts Q&A                       07:00 PM     SQLSaturday Chicago After Party                 LiveJournal Tags: SQL,SQL Saturday,PASS,PowerShell,Free Training

Hyper-V SCVMM Slide Deck for PASS

As promised here is my slide deck for the Virtualization VC of PASS that I used in my presentation on April 7th.  Hopefully the recording should be up soon.  If you have any questions about the deck please drop me a comment below. By the way, if you happen to be in the Richmond area this weekend I’ll be speaking on Virtualization at SQL Saturday #30. Start Time Track 1 Track 2 Track 3 Track 4 08:30 AM Brett Tomson Introduction to SSRS 2008 Bob Lambert The Business End of Data Modeling Jeremiah Peschka Fundamentals of SQL Server Internals Jason Hall Things Your Mom Never Told You About SSMS 09:45 AM Tom Robinson SSAS Basic Cube and dimension design Bob Lambert Normalize Metadata for Data Integration Analysis Ashton Hobbs Compression in SQL 2008 Mike Femenella Introduction to Performance Tuning 11:00 AM Brian Garraty Integration Services in the Real World Brett Tomson Growing Pains – A Cautionary Tale Dan Crawford SQL Service Brokers Jeremiah Peschka A Dynamic World Demands Dynamic SQL 01:00 PM Tom Robinson Building SSRS Reports from SSAS Cubes Louis Davidson Database Design Mike Femenella Loading Data In Real Time Janis Griffin Tuner Helper – A Proven Process In Tuning For DBAs* 02:15 PM Steve Wright Memory Management in SQL Server Analysis Services Louis Davidson Database Design Patterns Allen White Automate SQL Server Administration with PowerShell Dan Crawford SQL Server Spatial Data 03:30 PM Brock Beatty SQL 2008 Change Data Capture Tips and Tricks Aaron Nelson Virtualize This! Allen White Gather SQL Server Performance Data with PowerShell Susan Lennon Using SSRS to report on IIS Web Logs LiveJournal Tags: Virtualization

Speaking at the Virtualization VC of PASS Today

PASS in online today and we’ve got a great presentation for you.  We’ve teamed up with Dushyanth Nataraj from VMware to put together a session that should help DBAs get their feet wet with using some of the common features/strengths of Virtualization.  I’ll be doing a short presentation on Microsoft’s System Center Virtual Machine Manager showing folks how to move storage, copy machines, snapshots and reverts, and anything else I can squeeze into 20 minutes (Maybe some PowerShell?). Dushyanth is presenting an overview of VMware vCenter Lab Manager demostrating how VMware vSphere and Lab Manager can help you build a internal cloud for dev/test. We finish up with a demo of Lab Manager running a SQL workload showcasing how you can use the product for test/dev. Using Virtualization to Solve Common Dev/QA Environment Problems April 7th Noon Eastern (GMT -4) Presenters: Aaron Nelson & Dushyanth Nataraj How do I view the presentation? Click here to join the webcast. This will be my first time trying to switching presenting between two different presenters with seperate demos, but we are pretty sure we can pull it off.  If we want to follow along note that everything I’m presenting is done in SCVMM and everything Dushyanth does is in VMware; hopefully that works out as well. A big hat-tip goes out to my awsome coworker, Adeel Abbas, for helping me get this presentation working quickly by setting up my Domain Controller for me. By the way…did you see the Scripting Guys articles from last week? Grab this badge here!

T-SQL Tuesday #005 – Reporting

Invitation for T-SQL Tuesday #005- Reporting Spring Break or not, time marches on and so does T-SQL Tuesday.  I’ll be your host this month and we are going with “Reporting”.  The Post must go live between 00:00:00 GMT on Tuesday the 13th of April and 00:00:00 GMT on Wednesday the 14th (also known as 8pm EDT, 5pm PDT). You Don’t Know What T-SQL Tuesday Is Yet? Adam Machanic (Also on twitter as @AdamMachanic) had a great idea 5 months back – Invite new and existing SQL Server bloggers to post about the same topic on the same day. The results have been excellent – diverse skill sets and data related job roles all posting from differing perspectives on the same issue. Since this is still early in the game, a quick list of the post roundups from the first 4 topics: #001 Adam Machanic started this off with a topic of Date/Time tricks #002 Adam then wanted to hear about your Puzzling Situations #003 Rob Farley got romantic on us and asked about Relationships #004 Mike Walsh wanted to glean the ins and outs of IO Reporting Reporting is a potentially huge topic so here are just a handful of ideas that might get you started: Server Performance Reporting Technologies to help offload reporting Reporting services tricks T-SQL tricks for presentation and formatting Database design considerations for reporting Self-service reports Reports for executives Reporting from Oracle in SSRS Don’t forget that the DMVs are pretty much qualified as ‘Reports’ so those count too! Pesky little rules… Once again, please note the time is in GMT (occasionally called UTC). I also echo earlier encouragements to feel free to write your post ahead of time and schedule it. The rules are around when the post publishes, not when it is written.These rules are the same as the previous couple of T-SQL Tuesday’s but I’ll recap: The Post must go live between 00:00:00 GMT on Tuesday the 13th of April and 00:00:00 GMT on Wednesday the 14th (also known as 8pm EDT, 5pm PDT). If it isn’t, it can’t be included in the round up post. Your post must link back to this post (Trackback or Comment). “T-SQL Tuesday #005” MUST be in the title of the post. It is your responsibility to verify the trackback or comment appears here on this post.  If you don’t see your trackback add your own comment with a link back to your T-SQL Tuesday post and it will be included in the roundup. Twitter Not a rule but a great idea. A lot of the folks who read and participate are on twitter. Follow the hashtag #TSQL2sDay and when your post goes live, tweet a link to it with that tag. Want To Host? All you have to do is participate in at least two events and let Adam Machanic know. You can tweet him or leave a comment on his blog, all described in his first T-SQL Tuesday Invitation. If you need any more clarification, leave a comment. I will respond in the comments or update this post if necessary. Have fun thinking of a topic and I look forward to reading the posts!