SQLServerCentral.com | 3/12/2010 7:50:26 AM
This evening I had the opportunity to once again give a presentation at our local SQL Uses Group (SSSOLV). I went into the presentation with the hope of trying to encourage participation and group discussion. I think the presentation started off a little shaky for a couple of reasons. I had sent out an email requesting additional info to help prep for the presentation – however, I sent it late which impacted the feedback. I also didn’t review the PASS Monthly slide deck and sort of shot from the hip going through that stuff. Despite that, the presentation went well. I had several people give good feedback. They liked the presentation!! Participation really went well and it felt more like a conversation than a presentation – that is a good thing. Probably the best thing to come from the presentation was the resounding support in favor of trying to get a SQLSaturday down here. With that info, it looks like I will be starting the process to host a SQLSaturday and organize it from our side. Another benefit to be derived from this presentation is a growing warmup that has been happening with the group. Each presentation I have given has improved in group participation. That would be coming from both sides – I am sure. Going back to some of my early blogs about participating in the Local User’s Groups, I want to reiterate how good it feels to participate. I am glad I have had the opportunities to present.
This evening I had the opportunity to once again give a presentation at our local SQL Uses Group (SSSOLV). I went into the presentation with the hope of trying to encourage participation and group discussion.
I think the presentation started off a little shaky for a couple of reasons. I had sent out an email requesting additional info to help prep for the presentation – however, I sent it late which impacted the feedback. I also didn’t review the PASS Monthly slide deck and sort of shot from the hip going through that stuff.
Despite that, the presentation went well. I had several people give good feedback. They liked the presentation!! Participation really went well and it felt more like a conversation than a presentation – that is a good thing.
Probably the best thing to come from the presentation was the resounding support in favor of trying to get a SQLSaturday down here. With that info, it looks like I will be starting the process to host a SQLSaturday and organize it from our side.
Another benefit to be derived from this presentation is a growing warmup that has been happening with the group. Each presentation I have given has improved in group participation. That would be coming from both sides – I am sure. Going back to some of my early blogs about participating in the Local User’s Groups, I want to reiterate how good it feels to participate. I am glad I have had the opportunities to present.
SQLServerCentral.com | 3/12/2010 7:47:00 AM
My wife and I try to have dinner out every other week or so, but we tend to fall into ruts, visiting the same handful of restaurants that are close to home, reasonably priced, and reasonably dependable. Sometimes that dinner night comes at the end of a long week or a hectic day, and while we think (briefly) about trying something new, sometimes we just want something that meets our expectations, call it a comfort restaurant! If you’ve watched Spy Game you might recall ‘Operation: Dinner Out’ where Bishop is having food flown in from London, wanting some home cooked food. Good idea, so I borrowed the name and mangled it some for my entertainment needs at home. We went through the local Foodie awards and came up with a list of about 20 restaurants that we either have never been to, or it’s been a long time, and we’re going to try to work most of these in during the year. We tried it this past week, planning to go to the Four Rivers Smokehouse here in Orlando, not realizing that all they have is outdoor seating, this on a windy and chilly evening. Short of time on a Friday night we had to come up with Plan B, which turned out to be Smokey Bones. Ok food, extra credit for the pretzel appetizer – nice to have an option other than fried cheese! It’s interesting how having a list drives behavior. We’re not glued to it, but it does help us think about where we want to go. Even if we only discover one or two new favorites it’s worth the effort, and of course the conversation about where to go is always interesting, if you’re married you’ll know what I mean!
My wife and I try to have dinner out every other week or so, but we tend to fall into ruts, visiting the same handful of restaurants that are close to home, reasonably priced, and reasonably dependable. Sometimes that dinner night comes at the end of a long week or a hectic day, and while we think (briefly) about trying something new, sometimes we just want something that meets our expectations, call it a comfort restaurant!
If you’ve watched Spy Game you might recall ‘Operation: Dinner Out’ where Bishop is having food flown in from London, wanting some home cooked food. Good idea, so I borrowed the name and mangled it some for my entertainment needs at home. We went through the local Foodie awards and came up with a list of about 20 restaurants that we either have never been to, or it’s been a long time, and we’re going to try to work most of these in during the year.
We tried it this past week, planning to go to the Four Rivers Smokehouse here in Orlando, not realizing that all they have is outdoor seating, this on a windy and chilly evening. Short of time on a Friday night we had to come up with Plan B, which turned out to be Smokey Bones. Ok food, extra credit for the pretzel appetizer – nice to have an option other than fried cheese!
It’s interesting how having a list drives behavior. We’re not glued to it, but it does help us think about where we want to go. Even if we only discover one or two new favorites it’s worth the effort, and of course the conversation about where to go is always interesting, if you’re married you’ll know what I mean!
SQLServerCentral.com | 3/12/2010 7:46:00 AM
One of the dangers of being an “Internet Journalist” or even just a blogger, is that you might compromise who you are to attract readers. Or in the case of your “modern resume,” impress someone for a new job.Here is case of someone losing control of their ethics, for the sake of ratings. This is more of a journalism story, and the only person that I think it really hurts is the writer, but maybe that’s not true. Maybe it didn’t even hurt him. He still has a job.You, however, might not be so lucky.There are companies that would let you go if they found out you misrepresented yourself in an interview, or with a resume.Don’t write something for the sake of attracting or impressing readers. Write about what you know, and what you don’t. Admit your mistakes, and highlight your successes. Your blog, your presentations, your articles, are all a part of your career, and you should treat them as though they are precious. You are the product in your career, you are what you can sell, and your brand is what you have to sell.If people stop believing in that, you are in trouble.
SQLServerCentral.com | 3/12/2010 7:15:00 AM
I’ll be attending and speaking at the Orlando Code Camp on March 27, 2010 at Seminole State College along with Kendal Van Dyke, plus SQL sessions from Adam Jorgensen, Plamen Ratchev, Wes Dumey, and Sean Chambers. It’s always a good event, and I enjoy the chance to sit in on a couple .Net sessions to stay in touch with things in the world of code.
SQLblog.com - The SQL Server blog spot on the web | 3/12/2010 6:41:00 AM
“Whoever is careless with the truth in small matters cannot be trusted with important matters.” - Albert Einstein Share this post: email it! | bookmark it! | digg it! | reddit! | kick it! | live it!
“Whoever is careless with the truth in small matters cannot be trusted with important matters.” - Albert Einstein
SQLblog.com - The SQL Server blog spot on the web | 3/12/2010 6:00:00 AM
Introduction The PASS Board, continuing a trend of more openness championed by Board members, released the results of its Location Survey . Along with this, PASS President Rushabh Mehta added a blog post explaining the interpretation and logic behind the decision to not move the location of upcoming PASS Summits. Kudos Less than a week ago, Rushabh and I shared beverages and talked about life, database work, SSIS Frameworks, SQL Saturdays, PASS, and business. I know most members of the PASS Board...(read more)
SQLServerCentral.com | 3/12/2010 3:09:00 AM
Microsoft SSMS 2005 VIEW DEFINITION Incorrectly List the SQL Server 2008 Schema Objects which has public permission to access their own schema objectsReproduce the issue and please be aware of this 1. Created two Logins User_a and User_b which has default access permmission to the Test Database2. Created Two Schema Schema_a and Schema_b which has Schema owner accordingly User_a and User_b3. Granted the db_ddladmin for Default Schema Schema_a and Schema_b corresnponding to the user User_a and User_b4. Logged on User_a and excuted the following [SSMS 2008] Use Test Go CREATE TABLE Schema_a.Test(Sorurce int, cost int, partnumber int)5. Logged on User_b and excuted the following [SSMS 2008] Use Test Go CREATE TABLE Schema_b.Test(Sorurce int, cost int, partnumber int)6. SSMS 2008 enforce the VIEW DEFINITION and User_a List only the Schema_a.Test object as well as User_b list only the Schema_b.Test object.7. Unfortunately, when I try to connect using SSMS 2005 the user can view both tables [Schema_a.Test and Schema_b.Test] which is the issue with VIEW DEFINITION [Note: User can not read the data]
Microsoft SSMS 2005 VIEW DEFINITION Incorrectly List the SQL Server 2008 Schema Objects which has public permission to access their own schema objects
Reproduce the issue and please be aware of this
1. Created two Logins User_a and User_b which has default access permmission to the Test Database2. Created Two Schema Schema_a and Schema_b which has Schema owner accordingly User_a and User_b3. Granted the db_ddladmin for Default Schema Schema_a and Schema_b corresnponding to the user User_a and User_b4. Logged on User_a and excuted the following [SSMS 2008] Use Test Go CREATE TABLE Schema_a.Test(Sorurce int, cost int, partnumber int)5. Logged on User_b and excuted the following [SSMS 2008] Use Test Go CREATE TABLE Schema_b.Test(Sorurce int, cost int, partnumber int)6. SSMS 2008 enforce the VIEW DEFINITION and User_a List only the Schema_a.Test object as well as User_b list only the Schema_b.Test object.7. Unfortunately, when I try to connect using SSMS 2005 the user can view both tables [Schema_a.Test and Schema_b.Test] which is the issue with VIEW DEFINITION [Note: User can not read the data]
Andrew Fryer's Blog | 3/12/2010 1:58:50 AM
Hopefully you are aware of Tech Days in the UK during the week of 10-16 April, but you might not be aware of the After Hours evening event on the 14th April. This is still about technical stuff but with homage to scrap heap challenge and Top Gear, rather than the day events where we all concentrate on the business ready infrastructure world. It’s at the Vue Cinema in Fulham Broadway, but sadly I will be elsewhere as I am sure I will be standing a few pints for the hardworking MVP’s and community guys working on SQL Bits for the following day in Westminster.However if you are coming to both events this after hours session is great fun and a good newtworking opportunity.
Hopefully you are aware of Tech Days in the UK during the week of 10-16 April, but you might not be aware of the After Hours evening event on the 14th April. This is still about technical stuff but with homage to scrap heap challenge and Top Gear, rather than the day events where we all concentrate on the business ready infrastructure world. It’s at the Vue Cinema in Fulham Broadway, but sadly I will be elsewhere as I am sure I will be standing a few pints for the hardworking MVP’s and community guys working on SQL Bits for the following day in Westminster.
However if you are coming to both events this after hours session is great fun and a good newtworking opportunity.
SQL Server Community Blogs | 3/12/2010 1:21:00 AM
Everyone is different when it comes to learning, here are a few options to help you find your own preference....(read more)
SQLServerCentral.com | 3/12/2010 12:21:26 AM
Microsoft has recently announced that SharePoint 2010 and Office 2010 will RTM in April 2010, and will be officially launched on May 12, 2010. From historical experience, this means that the RTM bits will be available on MSDN Subscribers probably one to two weeks after it is declared RTM, and that SharePoint 2010 and Office 2010 will be available for purchase on May 12. That is not very far away… SharePoint 2010 requires SQL Server. Here is some information regarding the relationship between SharePoint 2010 and SQL Server. SharePoint Server 2010 Hardware and Software Requirements SharePoint 2010 is 64-bit only. It requires Windows Server 2008 SP2 or Windows Server 2008 R2. It will not run on a Server Core installation. It requires one of these versions of x64 SQL Server: SQL Server 2005 SP3 CU3 (Build 4220) or greater (Note: SQL Server 2005 goes out of mainstream support in April 2011) SQL Server 2008 SP1 CU2 (Build 2714) or greater SQL Server 2008 R2 Microsoft’s official position is still that SQL Server 2008 R2 will be available in the first half of 2010, even though the SharePoint team has announced a May 12 launch date. If I were planning on a brand new SharePoint 2010 deployment, I would want to be running on Windows Server 2008 R2, using SQL Server 2008 R2. This will give you the best performance and the most functionality. For example, PowerPivot in SharePoint 2010 requires SQL Server 2008 R2. I have put together some sample code that shows how to determine what edition and version of SQL Server is installed on an instance. This makes it easier to take advantage of version specific features (such as data compression) and edition specific features (such as online index creation) where appropriate.-- Method 1: Retrieve complete version info, parse results in C# SELECT @@VERSION AS [SQLVersionInfo];-- Method 2: Detecting the edition and version of SQL Server from T-SQL IF SERVERPROPERTY('EngineEdition') = 3BEGINPRINT 'Enterprise Edition'IF CONVERT(INT, CONVERT(FLOAT, CONVERT(VARCHAR(3), SERVERPROPERTY('productversion')))) > 9BEGINPRINT 'SQL Server 2008 or greater';-- Do something like use data compression on an indexENDELSEBEGINPRINT 'SQL Server 2005 or lower';-- Do something like create an index in online modeENDEND ELSEBEGINPRINT 'Standard Edition';-- Create an index in offline modeEND
Microsoft has recently announced that SharePoint 2010 and Office 2010 will RTM in April 2010, and will be officially launched on May 12, 2010. From historical experience, this means that the RTM bits will be available on MSDN Subscribers probably one to two weeks after it is declared RTM, and that SharePoint 2010 and Office 2010 will be available for purchase on May 12. That is not very far away…
SharePoint 2010 requires SQL Server. Here is some information regarding the relationship between SharePoint 2010 and SQL Server.
SharePoint Server 2010 Hardware and Software Requirements
SharePoint 2010 is 64-bit only. It requires Windows Server 2008 SP2 or Windows Server 2008 R2. It will not run on a Server Core installation.
It requires one of these versions of x64 SQL Server:
SQL Server 2005 SP3 CU3 (Build 4220) or greater (Note: SQL Server 2005 goes out of mainstream support in April 2011)
SQL Server 2008 SP1 CU2 (Build 2714) or greater
SQL Server 2008 R2
Microsoft’s official position is still that SQL Server 2008 R2 will be available in the first half of 2010, even though the SharePoint team has announced a May 12 launch date. If I were planning on a brand new SharePoint 2010 deployment, I would want to be running on Windows Server 2008 R2, using SQL Server 2008 R2. This will give you the best performance and the most functionality. For example, PowerPivot in SharePoint 2010 requires SQL Server 2008 R2.
I have put together some sample code that shows how to determine what edition and version of SQL Server is installed on an instance. This makes it easier to take advantage of version specific features (such as data compression) and edition specific features (such as online index creation) where appropriate.
-- Method 1: Retrieve complete version info, parse results in C# SELECT @@VERSION AS [SQLVersionInfo];-- Method 2: Detecting the edition and version of SQL Server from T-SQL IF SERVERPROPERTY('EngineEdition') = 3BEGINPRINT 'Enterprise Edition'IF CONVERT(INT, CONVERT(FLOAT, CONVERT(VARCHAR(3), SERVERPROPERTY('productversion')))) > 9BEGINPRINT 'SQL Server 2008 or greater';-- Do something like use data compression on an indexENDELSEBEGINPRINT 'SQL Server 2005 or lower';-- Do something like create an index in online modeENDEND ELSEBEGINPRINT 'Standard Edition';-- Create an index in offline modeEND
SQLServerCentral.com | 3/11/2010 9:43:26 PM
By now you’ve probably seen the official announcement from PASS about the Summit being located in Seattle for both 2011 and 2012, along with preliminary plans to host an event of some type on the East coast in the spring of 2011. There’s been a lot of good discussion on it, much of which you can find by reading this post by Jack Corbett, and checking the #sqlpass tag on Twitter. Now to add my few cents worth. As far as the survey, I think we got it wrong by not working harder at having unbiased questions, and we got it wrong by not understanding that it’s damned difficult to justify a decision that appears to be opposite of what the survey says. We were slow to put out the summary data, and I still hope we’ll release the raw data. We also didn’t make the effort to do some follow up polling to clarify the ranking of what was most important – location or MS participation at a super high volume? The decision to stay in Seattle really came down to a single point – Microsoft presence. Not cost, not venue, not whether the Summit would work in other cities, none of that was (in my opinion) even close to a deciding factor. Microsoft doesn’t “make” us hold the event in Seattle. Their public stance is pretty fair, we budget x dollars for the event, if you hold in Seattle we can send more people than if you hold it elsewhere, the difference being travel costs. From the PASS perspective that increased level of participation gives us: A marketing bullet point, a way to be seen as better/different than other conferences Increased attendance (MS people that is) which makes the conference “look” more successful Value to our attendees who have a chance to meet people on the SQL team outside of the usual presenters I balance that against wanting to reach people in other areas that we just won’t reach if we stay in Seattle. I know there’s been a lot of discussion about not much different in price to fly to one place or the other, but as an East coast guy I can tell you that it’s time – the time difference ends up adding a day each way to my trip, and that’s two days of work, or two days of billable hours for some. So, the question is, does the desire to reach different areas out weight the benefits I listed above? I think it does. We can still trumpet our great speaker lineup (including many from MS). Our attendance may drop due to fewer MS employees. Can we offset that with gains? I don’t know, but I can live with having perhaps 300 fewer attendees if it comes to that (and note, those aren’t full price attendees). The value to our attendees is important, and while I hate to diminish that, I know that we’ll still get the top 50 or top 100 MS people at the event, and then the next year or year after we’d get the whole crew again. I don’t mean to diminish the value that having developers from the SQL team participate in our event brings. It’s not just what we might learn from them, it’s what they learn from us. Our problems, our wishes, our passion. I think it’s one of the most important things we can do is provide a way for them to interact with us. I just don’t think it has to be every year. I voted against having it in Seattle in 2011 and 2012. I think a once in three year rotation would be fair, giving us the ability to host one in the middle of the country (Chicago, Dallas, Denver). I voted that way because I thought it was best for the community and that it would not cause any serious damage to PASS or the PASS Summit. I think the decision to remain in Seattle reflects the disparity many of us have seen in PASS from the beginning. PASS is more a business than a community. We should make good business decisions, protect the organization so that it lives on, but past that, too often we fail to make decisions that might be in the interest of the community more than in the business. I’m pleased to see more people speaking out, even if they don’t agree with me. We need that outside influence, especially when it’s focused on trying to do good and find compromises that work. But, speaking as an insider, and as perhaps a tired Board member, I’ll also say that if you want real change, you’re going to have to field some Board candidates that share your views of what PASS should be. I’ll post again soon about the upcoming elections and some thoughts about my term so far, in hopes of persuading the best and brightest of you to come serve your community for two years in a very visible way.
By now you’ve probably seen the official announcement from PASS about the Summit being located in Seattle for both 2011 and 2012, along with preliminary plans to host an event of some type on the East coast in the spring of 2011. There’s been a lot of good discussion on it, much of which you can find by reading this post by Jack Corbett, and checking the #sqlpass tag on Twitter. Now to add my few cents worth.
As far as the survey, I think we got it wrong by not working harder at having unbiased questions, and we got it wrong by not understanding that it’s damned difficult to justify a decision that appears to be opposite of what the survey says. We were slow to put out the summary data, and I still hope we’ll release the raw data. We also didn’t make the effort to do some follow up polling to clarify the ranking of what was most important – location or MS participation at a super high volume?
The decision to stay in Seattle really came down to a single point – Microsoft presence. Not cost, not venue, not whether the Summit would work in other cities, none of that was (in my opinion) even close to a deciding factor. Microsoft doesn’t “make” us hold the event in Seattle. Their public stance is pretty fair, we budget x dollars for the event, if you hold in Seattle we can send more people than if you hold it elsewhere, the difference being travel costs.
From the PASS perspective that increased level of participation gives us:
I balance that against wanting to reach people in other areas that we just won’t reach if we stay in Seattle. I know there’s been a lot of discussion about not much different in price to fly to one place or the other, but as an East coast guy I can tell you that it’s time – the time difference ends up adding a day each way to my trip, and that’s two days of work, or two days of billable hours for some. So, the question is, does the desire to reach different areas out weight the benefits I listed above?
I think it does. We can still trumpet our great speaker lineup (including many from MS). Our attendance may drop due to fewer MS employees. Can we offset that with gains? I don’t know, but I can live with having perhaps 300 fewer attendees if it comes to that (and note, those aren’t full price attendees). The value to our attendees is important, and while I hate to diminish that, I know that we’ll still get the top 50 or top 100 MS people at the event, and then the next year or year after we’d get the whole crew again.
I don’t mean to diminish the value that having developers from the SQL team participate in our event brings. It’s not just what we might learn from them, it’s what they learn from us. Our problems, our wishes, our passion. I think it’s one of the most important things we can do is provide a way for them to interact with us. I just don’t think it has to be every year.
I voted against having it in Seattle in 2011 and 2012. I think a once in three year rotation would be fair, giving us the ability to host one in the middle of the country (Chicago, Dallas, Denver). I voted that way because I thought it was best for the community and that it would not cause any serious damage to PASS or the PASS Summit.
I think the decision to remain in Seattle reflects the disparity many of us have seen in PASS from the beginning. PASS is more a business than a community. We should make good business decisions, protect the organization so that it lives on, but past that, too often we fail to make decisions that might be in the interest of the community more than in the business.
I’m pleased to see more people speaking out, even if they don’t agree with me. We need that outside influence, especially when it’s focused on trying to do good and find compromises that work. But, speaking as an insider, and as perhaps a tired Board member, I’ll also say that if you want real change, you’re going to have to field some Board candidates that share your views of what PASS should be.
I’ll post again soon about the upcoming elections and some thoughts about my term so far, in hopes of persuading the best and brightest of you to come serve your community for two years in a very visible way.
SQLServerCentral.com | 3/11/2010 8:47:41 PM
While it is probably out of reach for most DBAs in the United States to attend, the PASS European Conference is a great opportunity for those DBAs in Europe, who are unable to attend the PASS Community Summit in United States, to improve their skills and make new contacts within the DBA community. This year’s European PASS, which is to be held April 21-23 in Neuss, Germany (just outside of Dusseldorf), features more than 45 sessions from speakers from around the world. This event will also be the official SQL Server R2 launch in Europe, which includes an optional, full-day session will be conduced by Donald Farmer, focusing on new R2 features. In addition, there will be a R2 FastTrack that all conference attendees may attend. I will be presenting two sessions at this event, including: Essential DBA Skills: Best Practices Every SQL Server DBA Must Know How to Analyze Performance Monitor Data Using PAL I will be giving away free paperback copies of several of my books during my sessions on a first-come, first-serve basis. Hope to see you there.
While it is probably out of reach for most DBAs in the United States to attend, the PASS European Conference is a great opportunity for those DBAs in Europe, who are unable to attend the PASS Community Summit in United States, to improve their skills and make new contacts within the DBA community.
This year’s European PASS, which is to be held April 21-23 in Neuss, Germany (just outside of Dusseldorf), features more than 45 sessions from speakers from around the world.
This event will also be the official SQL Server R2 launch in Europe, which includes an optional, full-day session will be conduced by Donald Farmer, focusing on new R2 features. In addition, there will be a R2 FastTrack that all conference attendees may attend.
I will be presenting two sessions at this event, including:
I will be giving away free paperback copies of several of my books during my sessions on a first-come, first-serve basis. Hope to see you there.
Tips, Tricks, and Advice from the SQL Server Query Processing Team | 3/11/2010 8:34:00 PM
If you examine Showplan XML, you may find an entry like <MemoryFractions Input="1" Output="1" /> on some operators . They are internal parameters used by query memory grant to save overall memory usage, and “fraction” means how much this operator is allowed to use from “total additional memory” (please see previous post for definition on additional memory).For example, let’s consider the following hypothetical plan:SORT – HJ (hash join) – complex build side child |--- probe side childSince server knows HJ does not need to access its build-side once hash table is built, it can delay creation of sort table until HJ is ready to output joined rows. Then SORT can reuse memory previously used by HJ build side child. This is done by observing input (building hash table) to output (probing) phase transition by HJ.So what’s the practical use of these values? Not much beyond confirming memory grant usage, if the fraction is comparable to 1. If it is very small (say 0.1), however, the query may be susceptible for bad cardinality estimate. If you experience bad performance due to disk spilling and see such small number in Showplan XML, then it may be a good starting point for investigation.--- Jay Choe, SQL Server Engine
If you examine Showplan XML, you may find an entry like <MemoryFractions Input="1" Output="1" /> on some operators . They are internal parameters used by query memory grant to save overall memory usage, and “fraction” means how much this operator is allowed to use from “total additional memory” (please see previous post for definition on additional memory).
For example, let’s consider the following hypothetical plan:
SORT – HJ (hash join) – complex build side child |--- probe side child
Since server knows HJ does not need to access its build-side once hash table is built, it can delay creation of sort table until HJ is ready to output joined rows. Then SORT can reuse memory previously used by HJ build side child. This is done by observing input (building hash table) to output (probing) phase transition by HJ.
So what’s the practical use of these values? Not much beyond confirming memory grant usage, if the fraction is comparable to 1. If it is very small (say 0.1), however, the query may be susceptible for bad cardinality estimate. If you experience bad performance due to disk spilling and see such small number in Showplan XML, then it may be a good starting point for investigation.
--- Jay Choe, SQL Server Engine
SQLServerCentral.com | 3/11/2010 7:33:43 PM
I got a little distracted after lunch and was reading through some of the various bloggers reactions to the decision to keep the Summit in Seattle for the forseeable future. I enjoyed Brent Ozar’s take on the situation, but the thing that struck me square in the eyes and inspired me to add one more post of my own, was a comment on Brent’s post by Aaron. Scroll down and read it. Here’s the part that really made an impact: This whole situation is making me less interested in supporting the organization. As a relative newcomer to PASS and having never attended a Summit, I’m turned off by the “come talk to Microsoft employees” stance. I’d rather them say come and talk to (or sing Karaoke with?) cool guys like Brent Ozar and others in the community who deal with real world issues day to day. The arguments for keeping the Summit in Seattle largely boiled down to cost & access to Microsoft. Cost has been beat about the face & neck by me & others, and I can’t add anything else even marginally intelligent to the conversation, so I’ll shut up on that. Microsoft. Yeah, having access to Microsoft makes the Summit pretty cool (not to mention useful, a couple of my favorite sessions were from Microsoft presenters). PASS stands for the Professional Association of SQL Server users. The summit is produced by PASS in order to meet it’s own goals which are ”dedicated to supporting, educating, and promoting the Microsoft SQL Server community.” (Yeah, silly me, I go and read the organization’s web site). So here’s my comment. Is the community PASS is trying to support, educate and promote better represented by a bunch of Microsoft developers, or, to quote Aaron, “Brent Ozar and others in the community who deal with real world issues day to day?” And, lest I take an inappropriate beating, I’m neither knocking Microsoft developers, nor saying that they’re not a part of the community. My job and, to a small degree, my life, wouldn’t be the same without those people. I just want to make sure any rocks tossed my way are thrown for the right reasons.
I got a little distracted after lunch and was reading through some of the various bloggers reactions to the decision to keep the Summit in Seattle for the forseeable future. I enjoyed Brent Ozar’s take on the situation, but the thing that struck me square in the eyes and inspired me to add one more post of my own, was a comment on Brent’s post by Aaron. Scroll down and read it. Here’s the part that really made an impact:
This whole situation is making me less interested in supporting the organization. As a relative newcomer to PASS and having never attended a Summit, I’m turned off by the “come talk to Microsoft employees” stance. I’d rather them say come and talk to (or sing Karaoke with?) cool guys like Brent Ozar and others in the community who deal with real world issues day to day.
The arguments for keeping the Summit in Seattle largely boiled down to cost & access to Microsoft. Cost has been beat about the face & neck by me & others, and I can’t add anything else even marginally intelligent to the conversation, so I’ll shut up on that. Microsoft. Yeah, having access to Microsoft makes the Summit pretty cool (not to mention useful, a couple of my favorite sessions were from Microsoft presenters). PASS stands for the Professional Association of SQL Server users. The summit is produced by PASS in order to meet it’s own goals which are ”dedicated to supporting, educating, and promoting the Microsoft SQL Server community.” (Yeah, silly me, I go and read the organization’s web site).
So here’s my comment. Is the community PASS is trying to support, educate and promote better represented by a bunch of Microsoft developers, or, to quote Aaron, “Brent Ozar and others in the community who deal with real world issues day to day?”
And, lest I take an inappropriate beating, I’m neither knocking Microsoft developers, nor saying that they’re not a part of the community. My job and, to a small degree, my life, wouldn’t be the same without those people. I just want to make sure any rocks tossed my way are thrown for the right reasons.
Journey to SQL Authority with Pinal Dave | 3/11/2010 7:30:00 PM
I am recently working on upgrading my class Microsoft SQL Server 2005/2008 Query Optimization and & Performance Tuning with additional details and more interesting examples. While working on slide deck I realized that I need to have one solid slide which talks about checklist for analyzing slow running queries. A quick search on my saved [...]
SQLServerCentral.com | 3/11/2010 7:00:00 PM
This post is the second post in my series about Database mirroring. For part one is titled Configuring Database Mirroring in SQL Server. I believe that high availability is the primary reason people mirror their important production databases. Depending on your situation there can be some other benefits of using mirroring that can help performance of your production database. With database mirroring in SQL Server you have two exact copies of your production database on two separate instances , wouldn’t it be nice to have access to that mirrored database to act as a read-only database supporting all your reporting requirements? This post will show how to set that up.So we have our mirrored database all setup and its sat in a RECOVERING state, so how can we use it as reporting solution? Well, the answer lies in another feature new to SQL 2005… Database Snapshots.You can’t run queries against your mirrored DB because it is a in a RECOVERING state but you can create a snapshot of your mirrored database and run queries against that…here’s how:You need to get the logical file names of the data files that make up the mirrored database, these will be the same for both databases, to get these I run the following script against the principal database:use MirrorDBtestGoselect * from sysfilesThe result of this query is:So with the logical name of my data fileI run the following CREATE DATABASE statement to create a snapshot on the mirror database:CREATE DATABASE MirrorDBTestSSON (NAME = 'MirrorDBtest', FILENAME = 'C:\DATA\SQLServer2008\MirrorDBTest_mirror.snp')AS SNAPSHOT OF MirrorDBtestIn the above script I specifying the location of the snapshot file on the secondary instance Once this script has been run you should have a fully fledged database snapshot created against the mirrored database. You can then run queries against the snapshot: Related Posts:Part 1 - Configuring Database Mirroring in SQL Server.
This post is the second post in my series about Database mirroring. For part one is titled Configuring Database Mirroring in SQL Server. I believe that high availability is the primary reason people mirror their important production databases. Depending on your situation there can be some other benefits of using mirroring that can help performance of your production database. With database mirroring in SQL Server you have two exact copies of your production database on two separate instances , wouldn’t it be nice to have access to that mirrored database to act as a read-only database supporting all your reporting requirements? This post will show how to set that up.
So we have our mirrored database all setup and its sat in a RECOVERING state, so how can we use it as reporting solution? Well, the answer lies in another feature new to SQL 2005… Database Snapshots.
You can’t run queries against your mirrored DB because it is a in a RECOVERING state but you can create a snapshot of your mirrored database and run queries against that…here’s how:
You need to get the logical file names of the data files that make up the mirrored database, these will be the same for both databases, to get these I run the following script against the principal database:
use MirrorDBtestGoselect * from sysfiles
The result of this query is:
So with the logical name of my data file
I run the following CREATE DATABASE statement to create a snapshot on the mirror database:
CREATE DATABASE MirrorDBTestSSON (NAME = 'MirrorDBtest', FILENAME = 'C:\DATA\SQLServer2008\MirrorDBTest_mirror.snp')AS SNAPSHOT OF MirrorDBtest
Once this script has been run you should have a fully fledged database snapshot created against the mirrored database.
You can then run queries against the snapshot:
Related Posts:
Part 1 - Configuring Database Mirroring in SQL Server.
Glenn Berry's SQL Server Performance | 3/11/2010 5:21:26 PM
Microsoft has recently announced that SharePoint 2010 and Office 2010 will RTM in April 2010, and will be officially launched on May 12, 2010. From historical experience, this means that the RTM bits will be available on MSDN Subscribers probably one to two weeks after it is declared RTM, and that SharePoint 2010 and Office 2010 will be available for purchase on May 12. That is not very far away… SharePoint 2010 requires SQL Server. Here is some information regarding the relationship between SharePoint 2010 and SQL Server. SharePoint Server 2010 Hardware and Software Requirements SharePoint 2010 is 64-bit only. It requires Windows Server 2008 SP2 or Windows Server 2008 R2. It will not run on a Server Core installation. It requires one of these versions of x64 SQL Server: SQL Server 2005 SP3 CU3 (Build 4220) or greater (Note: SQL Server 2005 goes out of mainstream support in April 2011) SQL Server 2008 SP1 CU2 (Build 2714) or greater SQL Server 2008 R2 Microsoft’s official position is still that SQL Server 2008 R2 will be available in the first half of 2010, even though the SharePoint team has announced a May 12 launch date. If I were planning on a brand new SharePoint 2010 deployment, I would want to be running on Windows Server 2008 R2, using SQL Server 2008 R2. This will give you the best performance and the most functionality. For example, PowerPivot in SharePoint 2010 requires SQL Server 2008 R2. I have put together some sample code that shows how to determine what edition and version of SQL Server is installed on an instance. This makes it easier to take advantage of version specific features (such as data compression) and edition specific features (such as online index creation) where appropriate.-- Method 1: Retrieve complete version info, parse results in C#SELECT @@VERSION AS [SQLVersionInfo];-- Method 2: Detecting the edition and version of SQL Server from T-SQLIF SERVERPROPERTY('EngineEdition') = 3BEGIN PRINT 'Enterprise Edition'IF CONVERT(INT, CONVERT(FLOAT, CONVERT(VARCHAR(3), SERVERPROPERTY('productversion')))) > 9BEGIN PRINT 'SQL Server 2008 or greater';-- Do something like use data compression on an indexEND ELSE BEGIN PRINT 'SQL Server 2005 or lower';-- Do something like create an index in online modeEND END ELSE BEGIN PRINT 'Standard Edition';-- Create an index in offline modeEND
-- Method 1: Retrieve complete version info, parse results in C#SELECT @@VERSION AS [SQLVersionInfo];-- Method 2: Detecting the edition and version of SQL Server from T-SQLIF SERVERPROPERTY('EngineEdition') = 3BEGIN PRINT 'Enterprise Edition'IF CONVERT(INT, CONVERT(FLOAT, CONVERT(VARCHAR(3), SERVERPROPERTY('productversion')))) > 9BEGIN PRINT 'SQL Server 2008 or greater';-- Do something like use data compression on an indexEND ELSE BEGIN PRINT 'SQL Server 2005 or lower';-- Do something like create an index in online modeEND END ELSE BEGIN PRINT 'Standard Edition';-- Create an index in offline modeEND
SQL Server Community Blogs | 3/11/2010 4:07:00 PM
This post will be about coding standards. There are countless articles and blog posts related to this topic, so I know this post will not be too revealing. Yet I would like to mention a few things I came across during my work with the T-SQL code. Naming convention - there are many of them obviously. Too bad if all of them are used in the same database, and sometimes even in the same stored procedure. It is not uncommon to see something like create procedure dbo . Proc1 ( @ParamId int ) as begin declare...(read more)
SQLServerCentral.com | 3/11/2010 3:00:51 PM
Or “Shot gun query tuning” There have been a fair few forums questions in recent months asking for help in removing index scans, loop joins, sorts or other, presumed, slow query operators. There have been just as many asking how to replace a subquery with a join or a join with a subquery or similar aspects of a query usually for performance reasons. The first question that I have to ask when looking at requests like that is “Why?” Why is removing a particular query operator the goal? Why is changing a where clause predicate the goal? If it’s to make the query faster, has the query been examined and has it been confirmed that query operator or predicate really is the problem? The title of this post refers to a comment I’ve seen again and again in blogs or articles about front-end development. “Premature optimisation is the root of all evils.” It’s true in the database field as well. While optimisation is very important in database development, trying to optimise queries without any idea where the problem with the query is, or even if the query is a problem at all is about as effective in fixing a database performance problem as using a shotgun from 100 meters is in killing mosquitoes. If you hit the problem, it’s by shear luck and nothing else. There’s two sides to this problem. The first aspect of this is, during development, spending time on optimising a query (or stored procedure) without any idea whether or not the query is inefficient and no idea whether or not the changes made make any improvement or not. Firstly this is a waste of time that could be better spent developing other queries. Second it creates an incorrect impression that the queries have been optimised when in fact nothing of the sort has been done. The second aspect when, with a production database that is performing badly, queries are modified almost at random in an attempt to fix the performance problem quickly. This almost never works. It wastes time fixing stuff that very likely isn’t broken in the first place all the while the database performance deteriorates and management curses SQL Server as ‘nonscalable’ So, what is the right approach for the above two scenarios? Don’t optimise queries without knowing if they need it. Don’t optimise queries without knowing if they need it. 1 New development When writing queries and stored procedures they need to be tested against a representative data set on a server with representative workload and their performance characteristics evaluated to see if they are acceptable. If the query’s performance characteristics are acceptable, then that query requires no optimisation2 This doesn’t mean write bad code and push it to production. It means write good, solid code, following accepted coding standards, ensure that it runs acceptably against production-volumes of data, and do not spend hours or days trying to get it running a couple of milliseconds faster. And if the query doesn’t perform acceptable, identify the problematic portion and fix that, don’t flail around rewriting bits of the query in the hope that the problem will magically go away. The execution plan is the primary tool here, along with the output of Statistics IO. Fixing existing code When evaluating existing databases with know performance problems, limit the performance tuning to queries that really are performing badly and need optimisation. It’s often true that fixing the top 5-10 worst performing queries will have massive effects in overall system performance, far more than tuning twice that number of queries that aren’t really a problem. The best tool for finding which queries really are the worst offenders is SQL Trace. When looking at queries that are a problem, identify the portions that are inefficient and target attempts at optimisation towards those problems. In conclusion Measure Twice. Optimise if necessary. (1) No, that wasn’t a typo. (2) At that time. Later changes to schema or data volume may require existing queries to be revised. For more details on exactly how to identify problematic queries, refer to the series I wrote at Simple Talk last year.
Or “Shot gun query tuning”
There have been a fair few forums questions in recent months asking for help in removing index scans, loop joins, sorts or other, presumed, slow query operators. There have been just as many asking how to replace a subquery with a join or a join with a subquery or similar aspects of a query usually for performance reasons.
The first question that I have to ask when looking at requests like that is “Why?”
Why is removing a particular query operator the goal? Why is changing a where clause predicate the goal? If it’s to make the query faster, has the query been examined and has it been confirmed that query operator or predicate really is the problem?
The title of this post refers to a comment I’ve seen again and again in blogs or articles about front-end development. “Premature optimisation is the root of all evils.” It’s true in the database field as well.
While optimisation is very important in database development, trying to optimise queries without any idea where the problem with the query is, or even if the query is a problem at all is about as effective in fixing a database performance problem as using a shotgun from 100 meters is in killing mosquitoes. If you hit the problem, it’s by shear luck and nothing else.
There’s two sides to this problem.
The first aspect of this is, during development, spending time on optimising a query (or stored procedure) without any idea whether or not the query is inefficient and no idea whether or not the changes made make any improvement or not.
Firstly this is a waste of time that could be better spent developing other queries. Second it creates an incorrect impression that the queries have been optimised when in fact nothing of the sort has been done.
The second aspect when, with a production database that is performing badly, queries are modified almost at random in an attempt to fix the performance problem quickly.
This almost never works. It wastes time fixing stuff that very likely isn’t broken in the first place all the while the database performance deteriorates and management curses SQL Server as ‘nonscalable’
So, what is the right approach for the above two scenarios?
When writing queries and stored procedures they need to be tested against a representative data set on a server with representative workload and their performance characteristics evaluated to see if they are acceptable. If the query’s performance characteristics are acceptable, then that query requires no optimisation2
This doesn’t mean write bad code and push it to production. It means write good, solid code, following accepted coding standards, ensure that it runs acceptably against production-volumes of data, and do not spend hours or days trying to get it running a couple of milliseconds faster.
And if the query doesn’t perform acceptable, identify the problematic portion and fix that, don’t flail around rewriting bits of the query in the hope that the problem will magically go away.
The execution plan is the primary tool here, along with the output of Statistics IO.
When evaluating existing databases with know performance problems, limit the performance tuning to queries that really are performing badly and need optimisation. It’s often true that fixing the top 5-10 worst performing queries will have massive effects in overall system performance, far more than tuning twice that number of queries that aren’t really a problem.
The best tool for finding which queries really are the worst offenders is SQL Trace.
When looking at queries that are a problem, identify the portions that are inefficient and target attempts at optimisation towards those problems.
Measure Twice. Optimise if necessary.
(1) No, that wasn’t a typo.
(2) At that time. Later changes to schema or data volume may require existing queries to be revised.
For more details on exactly how to identify problematic queries, refer to the series I wrote at Simple Talk last year.
SQLServerPedia | 3/11/2010 2:38:29 PM
There has been a lot of blog chatter in the past week regarding the PASS Summit Survey. I won’t bother pointing you to each and every post and comment that has been made, as Jack Corbett has already done a great job of that. What I want to do is tell the PASS Community why [...]
SQL Server Community Blogs | 3/11/2010 2:20:55 PM
The XML Source in SSIS is great if you have a 1 to 1 mapping between entity and table. You can do more complex mapping but it becomes very messy and won't perform. What other options do you have? The challenge with XML processing is to not need a huge amount of memory. I remember using the early versions of Biztalk with loaded the whole document into memory to map from one document type to another. This was fine for small documents but was an absolute killer for large documents. You therefore need a streaming approach. For flexibility however you want to be able to generate your rows easily, and if you've ever used the XmlReader you will know its ugly code to write. That brings me on to LINQ. The is an implementation of LINQ over XML which is really nice. You can write nice LINQ queries instead of the XMLReader stuff. The downside is that by default LINQ to XML requires a whole XML document to work with. No streaming. Your code would look like this. We create an XDocument and then enumerate over a set of annoymous types we generate from our LINQ statement XDocument x = XDocument.Load("C:\\TEMP\\CustomerOrders-Attribute.xml"); foreach (var xdata in (from customer in x.Elements("OrderInterface").Elements("Customer") from order in customer.Elements("Orders").Elements("Order") select new { Account = customer.Attribute("AccountNumber").Value , OrderDate = order.Attribute("OrderDate").Value } )) { Output0Buffer.AddRow(); Output0Buffer.AccountNumber = xdata.Account; Output0Buffer.OrderDate = Convert.ToDateTime(xdata.OrderDate); } As I said the downside to this is that you are loading the whole document into memory. I did some googling and came across some helpful videos from a nice UK DPE Mike Taulty http://www.microsoft.com/uk/msdn/screencasts/screencast/289/LINQ-to-XML-Streaming-In-Large-Documents.aspx. Which show you how you can combine LINQ and the XmlReader to get a semi streaming approach. I took what he did and implemented it in SSIS. What I found odd was that when I ran it I got different numbers between using the streamed and non streamed versions. I found the cause was a little bug in Mikes code that causes the pointer in the XmlReader to progress past the start of the element and thus foreach (var xdata in (from customer in StreamReader("C:\\TEMP\\CustomerOrders-Attribute.xml","Customer") from order in customer.Elements("Orders").Elements("Order") select new { Account = customer.Attribute("AccountNumber").Value , OrderDate = order.Attribute("OrderDate").Value } )) { Output0Buffer.AddRow(); Output0Buffer.AccountNumber = xdata.Account; Output0Buffer.OrderDate = Convert.ToDateTime(xdata.OrderDate); } These look very similiar and they are the key element is the method we are calling, StreamReader. This method is what gives us streaming, what it does is return a IEnumerable list of elements, because of the way that LINQ works this results in the data being streamed in, it returns the elements one at a tiem rather than building a collection of them. The key is the use of the IEnumerable and the "yield return" static IEnumerable<XElement> StreamReader(String filename, string elementName) { using (XmlReader xr = XmlReader.Create(filename)) { xr.MoveToContent(); while (xr.Read()) //Reads the first element { while (xr.NodeType == XmlNodeType.Element && xr.Name == elementName) { XElement node = (XElement)XElement.ReadFrom(xr); yield return node; } } xr.Close(); } } This code is specifically designed to return a list of the elements with a specific name. The first Read reads the root element and then the inner while loop checks to see if the current element is the type we want. If not we do the xr.Read() again until we find the element type we want. We then use the neat function XElement.ReadFrom to read an element and all its sub elements into an XElement. This is what is returned and can be consumed by the LINQ statement. Essentially once one element has been read we need to check if we are still on the same element type and name (the inner loop) This was Mikes mistake, if we called .Read again we would advance the XmlReader beyond the start of the Element and so the ReadFrom method wouldn't work. To get this working, 1. Put a script component in your data flow as a source component. 2. Then add the columns you wish to the output. 3. Add the StreamReader function to your script code 4. Put the first foreach in the CreateNewOutputRows method 4. Change the LINQ query etc to match what you want With the code above you can use what ever LINQ statement you like to flatten your XML into the rowsets you want. You could even have multiple outputs and generate your own surrogate keys.
The XML Source in SSIS is great if you have a 1 to 1 mapping between entity and table. You can do more complex mapping but it becomes very messy and won't perform. What other options do you have?
The challenge with XML processing is to not need a huge amount of memory. I remember using the early versions of Biztalk with loaded the whole document into memory to map from one document type to another. This was fine for small documents but was an absolute killer for large documents.
You therefore need a streaming approach.
For flexibility however you want to be able to generate your rows easily, and if you've ever used the XmlReader you will know its ugly code to write.
That brings me on to LINQ. The is an implementation of LINQ over XML which is really nice. You can write nice LINQ queries instead of the XMLReader stuff. The downside is that by default LINQ to XML requires a whole XML document to work with. No streaming.
Your code would look like this. We create an XDocument and then enumerate over a set of annoymous types we generate from our LINQ statement
XDocument x = XDocument.Load("C:\\TEMP\\CustomerOrders-Attribute.xml");
foreach (var xdata in (from customer in x.Elements("OrderInterface").Elements("Customer")
from order in customer.Elements("Orders").Elements("Order")
select new { Account = customer.Attribute("AccountNumber").Value
, OrderDate = order.Attribute("OrderDate").Value }
))
{
Output0Buffer.AddRow();
Output0Buffer.AccountNumber = xdata.Account;
Output0Buffer.OrderDate = Convert.ToDateTime(xdata.OrderDate);
}
As I said the downside to this is that you are loading the whole document into memory.
I did some googling and came across some helpful videos from a nice UK DPE Mike Taulty http://www.microsoft.com/uk/msdn/screencasts/screencast/289/LINQ-to-XML-Streaming-In-Large-Documents.aspx. Which show you how you can combine LINQ and the XmlReader to get a semi streaming approach. I took what he did and implemented it in SSIS. What I found odd was that when I ran it I got different numbers between using the streamed and non streamed versions. I found the cause was a little bug in Mikes code that causes the pointer in the XmlReader to progress past the start of the element and thus
foreach (var xdata in (from customer in StreamReader("C:\\TEMP\\CustomerOrders-Attribute.xml","Customer")
These look very similiar and they are the key element is the method we are calling, StreamReader. This method is what gives us streaming, what it does is return a IEnumerable list of elements, because of the way that LINQ works this results in the data being streamed in, it returns the elements one at a tiem rather than building a collection of them. The key is the use of the IEnumerable and the "yield return"
static IEnumerable<XElement> StreamReader(String filename, string elementName)
using (XmlReader xr = XmlReader.Create(filename))
xr.MoveToContent();
while (xr.Read()) //Reads the first element
while (xr.NodeType == XmlNodeType.Element && xr.Name == elementName)
XElement node = (XElement)XElement.ReadFrom(xr);
yield return node;
xr.Close();
This code is specifically designed to return a list of the elements with a specific name. The first Read reads the root element and then the inner while loop checks to see if the current element is the type we want. If not we do the xr.Read() again until we find the element type we want. We then use the neat function XElement.ReadFrom to read an element and all its sub elements into an XElement. This is what is returned and can be consumed by the LINQ statement. Essentially once one element has been read we need to check if we are still on the same element type and name (the inner loop) This was Mikes mistake, if we called .Read again we would advance the XmlReader beyond the start of the Element and so the ReadFrom method wouldn't work.
To get this working,
1. Put a script component in your data flow as a source component.
2. Then add the columns you wish to the output.
3. Add the StreamReader function to your script code
4. Put the first foreach in the CreateNewOutputRows method
4. Change the LINQ query etc to match what you want
With the code above you can use what ever LINQ statement you like to flatten your XML into the rowsets you want. You could even have multiple outputs and generate your own surrogate keys.
SQLblog.com - The SQL Server blog spot on the web | 3/11/2010 1:42:00 PM
Just curious who reads what. Maybe I am missing something... Share this post: email it! | bookmark it! | digg it! | reddit! | kick it! | live it!...(read more)
SQLblog.com - The SQL Server blog spot on the web | 3/11/2010 12:48:00 PM
I'm sorry I couldn't resist... Share this post: email it! | bookmark it! | digg it! | reddit! | kick it! | live it!...(read more)
SQLServerPedia | 3/11/2010 12:33:43 PM
I got a little distracted after lunch and was reading through some of the various bloggers reactions to the decision to keep the Summit in Seattle for the forseeable future. I enjoyed Brent Ozar’s take on the situation, but the thing that struck me square in the eyes and inspired me to add one more [...]
SQLblog.com - The SQL Server blog spot on the web | 3/11/2010 12:09:00 PM
This seems to be the survey season. Andy’s post on source controlling T-SQL code triggered a question that I always wanted to ask. Do you version control the source code for your various personal projects (i.e. not projects of your customer or employer)? Do you use a computer at home for your source control repository, or do you use a hosting service such as ProjectLocker ? If you do it yourself at home, what version control software you use? If you use a hosting service, what’s your experience?...(read more)