Posts belonging to Category SQLServerSyndication



Webcast Next Week – Using XML to Query Execution Plans

I’ll be speaking for the SQL PASS Database Administration Virtual Chapter next week.  It’ll be on July 28 at 12 PM Eastern time.  The topic will be Using XML to Query Execution Plans.  The abstract for the event is the following:

SQL Server stores its execution plans as XML in dynamic management views. The execution plans are a gold mine of information. From the whether or not the execution plan will rely on parallelism to what columns are requiring a key lookup after a non-clustered index seek. Through a the use of XML this information can be available at your fingertips to help determine the value and impact of an index and guide you in improving the performance of your SQL Server databases. In this session we’ll look at how you can begin to understand and query the structure of the execution plans in the procedure cache. Also, we’ll review how to uncover some potential performance issues that may be lurking in your SQL Server.

If you register for the event ahead of time you will be entered into a drawing brought to us from CA, our event sponsor.  You can get to the event here.

PASSMN July Meeting Today

Minnesota SQL Server Users Group

Don’t forget the July PASSMN meeting is today.  We have Itzik Ben-Gan (blog) coming in to talk about some query tuning tips.

Here are the meeting details…

Date and  Time:

July 20, 2010, 5:00 PM CST

Location:

8300 Norman Center Drive, 9th Floor, Bloomington, MN  55437 (map)

Live Meeting

Agenda:

5:00 –5:15 : Announcements
5:15 –5:25 : Sponsor
5:25 –6:45 : Query Tuning Tips (Itzik)
6:45 –7:00 : Survey Collection and Giveaways

Presentation:

Query Tuning Tips

Given a SQL Server querying problem there’s much that you can do to enable a good performing solution. Tuning involves arranging an optimal physical environment, e.g., by creating supporting indexes, as well as writing the query in a way that it would get an optimal execution plan. Many factors can affect the efficiency of the solution including the availability of indexes, data distribution and density, and others. In different scenarios, a different solution could be the most efficient for the same querying problem. Query tuning could be considered an art. This session will provide various tips to do efficient query tuning and demonstrate those through specific tuning examples.

Itzik Ben-Gan is a Mentor and Co-Founder of Solid Quality Mentors. A SQL Server Microsoft MVP (Most Valuable Professional) since 1999, Itzik has delivered numerous training events around the world focused on T-SQL Querying, Query Tuning and Programming. Itzik is the author of several books including Microsoft SQL Server 2008: T-SQL Fundamentals, Inside Microsoft SQL Server 2008: T-SQL Querying and Inside Microsoft SQL Server 2008: T-SQL Programming. He has written many articles for SQL Server Magazine as well as articles and whitepapers for MSDN. Itzik’s speaking activities include TechEd, DevWeek, SQLPASS, SQL Server Magazine Connections, various user groups around the world, and Solid Quality Mentors’ events to name a few. Itzik is the author of Solid Quality Mentors’ Advanced T-SQL Querying, Programming and Tuning and T-SQL Fundamentals courses along with being a primary resource within the company for their T-SQL related activities

PASSMN July Meeting Next Week

Minnesota SQL Server Users Group

The July PASSMN meeting is is coming up next week.  If you’ve not registered now’s a great time to get your RSVP in.  We have Itzik Ben-Gan (blog) coming in to talk about some query tuning tips.

Here are the meeting details…

Date and  Time:

July 20, 2010, 5:00 PM CST

Location:

8300 Norman Center Drive, 9th Floor, Bloomington, MN  55437 (map)

Live Meeting

Agenda:

5:00 –5:15 : Announcements
5:15 –5:25 : Sponsor
5:25 –6:45 : Query Tuning Tips (Itzik)
6:45 –7:00 : Survey Collection and Giveaways

Presentation:

Query Tuning Tips

Given a SQL Server querying problem there’s much that you can do to enable a good performing solution. Tuning involves arranging an optimal physical environment, e.g., by creating supporting indexes, as well as writing the query in a way that it would get an optimal execution plan. Many factors can affect the efficiency of the solution including the availability of indexes, data distribution and density, and others. In different scenarios, a different solution could be the most efficient for the same querying problem. Query tuning could be considered an art. This session will provide various tips to do efficient query tuning and demonstrate those through specific tuning examples.

Itzik Ben-Gan is a Mentor and Co-Founder of Solid Quality Mentors. A SQL Server Microsoft MVP (Most Valuable Professional) since 1999, Itzik has delivered numerous training events around the world focused on T-SQL Querying, Query Tuning and Programming. Itzik is the author of several books including Microsoft SQL Server 2008: T-SQL Fundamentals, Inside Microsoft SQL Server 2008: T-SQL Querying and Inside Microsoft SQL Server 2008: T-SQL Programming. He has written many articles for SQL Server Magazine as well as articles and whitepapers for MSDN. Itzik’s speaking activities include TechEd, DevWeek, SQLPASS, SQL Server Magazine Connections, various user groups around the world, and Solid Quality Mentors’ events to name a few. Itzik is the author of Solid Quality Mentors’ Advanced T-SQL Querying, Programming and Tuning and T-SQL Fundamentals courses along with being a primary resource within the company for their T-SQL related activities

Please RSVP here if you will be attending in person, this helps us understand how many people to tell the sponsor to get food for.

Webcast Today – Performance Impacts Related to Different Function Types

I’ll be speaking for the SQL PASS Performance Virtual Chapter later today starting at 12 PM Eastern time.  The topic will be Performance Impacts Related to Different Function Types.  The abstract for the event is the following:

User defined functions provide a means to encapsulate business logic in the database tier.  Often the purpose of the encapsulation is to provide standard method access segments of data within the database.  Unfortunately, not all methods of creating user defined functions are equal.  In this session we’ll review the types of user defined functions and investigate the performance impact in selecting the different types

Goals:

  • Identify purposes for creating user defined functions
  • Discuss the types of user-defined functions
  • Demonstrate performance impact in selecting different types of functions

You can get to the event here.

What Would You Build? MSDN Subscription Giveaway

Along with a number of my MVP peers, I received three (3) MSDN Ultimate subscriptions.  These were sent to us with the intention of finding someone that hasn’t had the opportunity to use Visual Studio 2010 and provide them with the opportunity to get in and play with it. 

MSDN Ultimate Subscription

If you aren’t familiar with the MSDN Ultimate Subscription, it’s the ultimate subscription that you can get from MSDN.  Yeah, I went there.  For real though, it is full access to the MSDN library that includes Visual Studio, Windows 7, etc.  This subscription licenses all of that software for you to use to build and develop applications.  If you’ve looked at MSDN Subscriptions before then you probably know that they run for around $12,000.

Now I need to figure out how to get rid of my three subscriptions.  Some MVPs have already determined how they are going to give theirs away.  Take a look at how some others are giving away their MSDN subscriptions like Arnie Rowland (blog | twitter), Ken Simmons (blog | twitter), Denis Gobo (blog | twitter), and Jeremiah Peschka (blog | twitter).

CodePlex

I’m a big fan of CodePlex.  This is a place where open source projects can be placed for others to use.   There are also a ton of cool tools out there that you can use to make life simpler, for instance:

Admittedly the last two project are my own.  But the rest are some cool projects that you should already be checking out.

The Contest

What does this have to do with CodePlex?  Well, that is the focus of the first of three methods to give the MSDN Subscriptions away.

So for the first of the three MSDN Ultimate Subscriptions, leave a comment on this blog with the description of the a project you are interested in building and placing on CodePlex for the community to share.  You will have between now and July 31st that to leave the comment.  I’ll choose the winner randomly between the comments.  Of course, you can only be in the drawing once.

The suggestions do not have to deal with SQL Server specifically, but I am sure most that read this probably use that fairly regularly.  Leave any other questions in the comments below. 

Aren’t There Three

Yes, there are.  Part of the purpose of receiving these subscriptions is to get them to people that haven’t had a chance to experience Visual Studio 2010.  When I get creative on another method to give away the other two, I’ll do a post for those.  Of course, if you have suggestions there is a comment section on this post.

MVP Status Renewed

2010-07-01 09.03.12 In anticipation of today, earlier this week I had declared today Pancake Day and started the day making pancakes.  It was a great way to blow through the first hour without wearing out the F5 key on my laptop.

Now the waiting is over and I am happy to say my SQL Server MVP status was renewed for 2010.  Awesome.

I’d like to thank everyone who has asked me questions, answered my questions and allowed me to present in the past year.  All of this and many other things helped contribute to this renewal. 

If you aren’t familiar with the Microsoft’s MVP program, it is designed by Microsoft to recognize individuals active in the SQL Server community.  These people have made contributions that help build and support the SQL Server community. 

A lot of well deserved people also had SQL Server MVP status awarded or renewed today.  Take a chance if you can and congratulate the following:

If I missed anyone, let me know and I’ll add them to the list.  Great group of folks.

Update 1:35 PM
Dropped a name I mistakenly added due to over excited clicking in Tweetdeck.  Added three more names that I missed earlier.

Update 1:55 PM
Added four more that I found out about after the last update. 

Update July 2, 2010
Fixed a few more names of MVPs.

MVCRE2BNZVF8

July PASSMN Meeting Announced

Lego DeadlockSometimes when we are putting together the user group meetings things change.  Opportunities arise and we get a chance to take a cool meeting and turn it into a great meeting.  That happened with this months meeting and it’s going to be great.

A couple things are different for this month… time and topic.  This month instead of meeting at 3:00 PM we are meeting at 5:00 PM.  And the reason for the change is that we have Itzik Ben-Gan (blog) stopping by for a presentation.

The Presentation

This month he’ll be teaching a course at Benchmark Learning.  His course is Advanced T-SQL Querying, Programming and Tuning for SQL Server 2005 & 2008.  If you want more than what you suspect will be at the meeting, then this class is for you.

What can you suspect will be at the meeting this month?  Well, how about this?

Query Tuning Tips

Given a SQL Server querying problem there’s much that you can do to enable a good performing solution. Tuning involves arranging an optimal physical environment, e.g., by creating supporting indexes, as well as writing the query in a way that it would get an optimal execution plan. Many factors can affect the efficiency of the solution including the availability of indexes, data distribution and density, and others. In different scenarios, a different solution could be the most efficient for the same querying problem. Query tuning could be considered an art. This session will provide various tips to do efficient query tuning and demonstrate those through specific tuning examples.

Pretty cool stuff, eh?

And the Rest of the Details…

This month’s meeting sponsor is Digineer.  They’ll be providing the food and beverages.  Digineer happens to be my employer and if you’re local and looking for a company with talent and skill this is a good place to look.

Date: July 20, 2010
Time: 5:00 PM – 7:00 PM
Location: 8300 Norman Center Drive, 9th Floor, Bloomington, MN  55437
Live Meeting

The all important RSVP link – please do RSVP so that we’ll have enough food for the event.

Displaying Microsoft Project Task’s Notes in SSRS 2008

Lego Deadlock

I was asked to take a look at an issue the other day regarding displaying Microsoft Project Task’s Notes in SSRS 2008.  If you’ve worked with building reports for Microsoft Project Server, you have no doubt dealt with the RTF data that is stored in the Task’s Notes fields.

With SQL Server 2005 Reporting Services (SSRS) it was easy to display this information by following the steps outlined in Christophe Fiessinger post “How to display Microsoft Project Task’s Notes field in a report”.

But What About SSRS 2008

With SSRS 2008, the Reporting Services engine was re-architected.  Some of this new architecture included an improvement in the underlying security.  The question is did these changes have an effect the method available in the blog previously linked.

Unfortunately, it does.  Instead of displaying notes from Project Server as desired, you end up with row after row of N/A – as seen below.

image As a result, the code used for SSRS 2005 to display the RTF will not work with SSRS 2008.  Digging into the error message reveals that the reason that all of the tasks display as N/A is the following error message:

System.Security.SecurityException: Request for the permission of type ‘System.Security.Permissions.UIPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′ failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at System.Windows.Forms.NativeWindow.CreateHandle(CreateParams cp)
at System.Windows.Forms.Control.CreateHandle()
at System.Windows.Forms.Control.get_Handle()
at System.Windows.Forms.Application.ParkHandle(CreateParams cp)
at System.Windows.Forms.Control.CreateHandle()
at System.Windows.Forms.TextBoxBase.CreateHandle()
at System.Windows.Forms.RichTextBox.set_Rtf(String value)
at ReportExprHostImpl.CustomCodeProxy.byteArrayToString(Byte[] b)
The action that failed was:
Demand
The type of the first permission that failed was:
System.Security.Permissions.UIPermission
The Zone of the assembly that failed was:
MyComputer

No good.  The solution fails to function anymore because of the attempt to implement System.Windows.Forms.RichTextBox from within SSRS.  The new security restriction prevent this.

Can It Be Implemented Differently?

Investigating this more, I found an post on the Microsoft forums that dealt with issue.  In that post, there was a reference to a StackOverflow question that also was looking for a solution to this issue.

Both posts point towards adding the following function to the report:

Public Function ConvertRtfToTextRegex(ByVal input As String) As String
        Dim returnValue As String = String.Empty
        returnValue = System.Text.RegularExpressions.Regex.Replace(input, "\{\*?\\[^{}]+}|[{}]|\\\n?[A-Za-z]+\n?(?:-?\d+)?[ ]?", "")
        Return returnValue
End Function

Instead of the code from the original Project Server post the code for the SSRS report should look like this:


'Instantiate a stringbuilder object
Public s As New System.Text.StringBuilder() 

Public Function byteArrayToString(ByVal b() As Byte) As String
    Dim i As Integer
    dim mystr as string 

Try
    s.length = 0 

    For i = 0 To b.Length - 1
        If i <> b.Length - 1 Then
            s.Append(chr(b(i)))
        End If
    Next 

    mystr = left(s.ToString, len(s.ToString)-1) 

    return ConvertRtfToTextRegex(mystr)
Catch ex as exception
    return ex.tostring()
    s.length = 0 

End Try
End Function 

Public Function ConvertRtfToTextRegex(ByVal input As String) As String
        Dim returnValue As String = String.Empty
        returnValue = System.Text.RegularExpressions.Regex.Replace(input, "\{\*?\\[^{}]+}|[{}]|\\\n?[A-Za-z]+\n?(?:-?\d+)?[ ]?", "")
        Return returnValue
End Function

After adding the new code, the values that come back start looking as they would have with SSRS 2005.  Problem solved!

image

Follow-Up

While I’ve provided a solution to this issue, there is a little more to be garnered from this solution.  That is the power of the SQL Server community.  In solving this I didn’t have to have any inherent knowledge of UIPermissions and how they got hosed up because SSRS 2008 is more secure.  This is a good thing by the way. I also didn’t have to know how to write a goofy regular expression.  Thank God!

All I had to do was to take what I knew and start to search for items that were similar and follow where the trail led me.  In this way the common knowledge of the community was shared previously and I am sharing it again myself.

It’s a good thing to share what you know.  Whether through answering questions on forums, writing blog posts, or participating in your local SQL Server user groups.  This helps raise the bar for everyone else and expands the knowledge of our community.

SQL Server Best Practice Whitepapers

OMG

If you talk to Sarah (twitter), she’ll tell you that I like lists.  Lists are awesome – they are almost like non-structured data.  They are hierarchies of information that I can work with.  They are Data.

Microsoft must have known I liked lists because over the weekend I discovered (see below) their SQL Server Best Practice Whitepapers list.

If you are looking to shore up your environment and skills, this is the place to start.  Check it out – you’ll find some great stuff here.

UPDATE:

By discover above… I should have mentioned that I saw it on a post by Mark Broadbent (blog | twitter).  Attribution is always a good thing and I feel bad that I missed that one.

Webcast Next Week – Performance Impacts Related to Different Function Types

I’ll be speaking for the SQL PASS Performance Virtual Chapter next week.  It’ll be on July 6 at 12 PM Eastern time.  The topic will be Performance Impacts Related to Different Function Types.  The abstract for the event is the following:

User defined functions provide a means to encapsulate business logic in the database tier.  Often the purpose of the encapsulation is to provide standard method access segments of data within the database.  Unfortunately, not all methods of creating user defined functions are equal.  In this session we’ll review the types of user defined functions and investigate the performance impact in selecting the different types

Goals:

  • Identify purposes for creating user defined functions
  • Discuss the types of user-defined functions
  • Demonstrate performance impact in selecting different types of functions

You can get to the event here.