<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>SQL Fool</title>
	
	<link>http://sqlfool.com</link>
	<description>Adventures in SQL Tuning - a blog for the rest of us</description>
	<pubDate>Tue, 10 Nov 2009 20:06:44 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/SqlFool" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Live Blogging:  Women In Technology Luncheon</title>
		<link>http://feedproxy.google.com/~r/SqlFool/~3/crptoo7JmEA/</link>
		<comments>http://sqlfool.com/2009/11/live-blogging-women-in-technology-luncheon/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 19:00:58 +0000</pubDate>
		<dc:creator>Michelle Ufford</dc:creator>
		
		<category><![CDATA[PASS]]></category>

		<category><![CDATA[Syndication]]></category>

		<category><![CDATA[live blogging]]></category>

		<category><![CDATA[Summit]]></category>

		<category><![CDATA[WIT]]></category>

		<guid isPermaLink="false">http://sqlfool.com/?p=1261</guid>
		<description><![CDATA[I was invited to live-blog for the Women In Technology (WIT) luncheon at the Summit on Tuesday.  As was the case with all of my &#8220;live blogging,&#8221; I mostly updated Twitter with near-real-time updates, which I then attempt to transcribe into a blog post for later reference.  So here follows that transcription.   [...]]]></description>
			<content:encoded><![CDATA[<p>I was invited to live-blog for the Women In Technology (WIT) luncheon at the Summit on Tuesday.  As was the case with all of my &#8220;live blogging,&#8221; I mostly updated Twitter with near-real-time updates, which I then attempt to transcribe into a blog post for later reference.  So here follows that transcription.  <img src='http://sqlfool.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>11:49 AM PST<br />
The room is filling up nicely!  There&#8217;s a nice distribution of men and women in the room.  This is great!  I&#8217;m actually pleasantly surprised at the number of women at the Summit.  If it weren&#8217;t for this luncheon, I probably wouldn&#8217;t have even noticed just how many SQL ladies there actually are.</p>
<p>12:00 PM PST<br />
The WIT luncheon is underway!  We start off with watching an energetic video displaying various types of women and men who each state &#8220;I am a technical woman&#8221; or &#8220;I support technical women.&#8221;</p>
<p>Rushabh Mehta, Executive VP of Finance for PASS, opens the WIT luncheon with the statement &#8220;PASS Supports Technical Women.&#8221;  He then hands the floor over to Wendy Pastrick (<a href="http://twitter.com/wendy_dance" target="_blank">@wendy_dance</a>) for moderation of today&#8217;s panel.</p>
<p>Today&#8217;s panel is:</p>
<ul>
<li><a href="http://www.sqlteam.com/author/kathi-kellenberger">Kathi Kellenberger</a> (<a href="http://twitter.com/auntkathi" target="_blank">@auntkathi</a>)</li>
<li><a href="http://jessicammoss.blogspot.com/" target="_blank">Jessica Moss</a> (<a href="http://twitter.com/jessicammoss" target="_blank">@jessicammoss</a>)</li>
<li><a href="http://www.ignite-us.org/" target="_blank">Cathi Rodgveller</a> (<a href="http://twitter.com/IgniteGirls" target="_blank">@IgniteGirls</a>)</li>
<li><a href="http://blogs.msdn.com/SoCalDevGal/" target="_blank">Lynn Langit</a> (<a href="http://twitter.com/llangit" target="_blank">@llangit</a>)</li>
</ul>
<p>12:10 PM PST<br />
Kathi starts off with a great message: &#8220;I want to encourage women to enter technology, but I want to encourage boys too.&#8221;  She started off as a pharmacist because &#8220;I was probably born 5 years too early&#8221; but later switched to technology.  She makes less money but enjoys it more.  Her daughter had to learn HTML for school and actually helped her get her first work in IT by showing her how to program.  &#8220;I want both boys and girls to have the opportunity to discover lots of different things and to find what they love.  And hopefully that&#8217;ll be technology.&#8221;</p>
<p>12:17 PM PST<br />
The floor is then handed over to Jessica Moss, BI guru extraordinaire.  She gives a great example of how influential a father can be in a young girl&#8217;s life: her father was the one who got her interested in technology and who encouraged her career.  She says she never felt like she could *not* be technical because she was raised to believe she could do anything.  She ends with a challenge for everyone at the Summit:  talk to just one young woman and encourage her interest in technology.</p>
<p>12:23 PM PST<br />
Cathi Rodgveller shares her background in education and how she started <a href="http://www.ignite-us.org/" target="_blank">IGNITE</a> (Inspiring Girls Now In Technology Evolution).  The goal of IGNITE is to excite young women, minority races, and low-income youth, about technology and about technical careers.   Rodgveller gives us a powerful message: &#8220;You can have an impact in your community.  One [positive technology] event can change a young girl&#8217;s life.&#8221;</p>
<p>12:28 PM PST<br />
Last, but certainly not least, Lynn Langit takes the floor.  She starts off with a challenge to all audience members:  tweet or text one person to say &#8220;I&#8217;m a technical women&#8221; or &#8220;I support technical women.&#8221;  The room gets active while people are busy typing or texting, and Twitter is abuzz with various tweets and retweets.  Lynn then takes the floor back and talks about her background and about her charity work.  She mentions that every time someone buys one of her books, a donation is made to the <a href="http://www.monafoundation.org/" target="_blank">MONA foundation</a>.  Langit also shares some of her experiences as a technical women: &#8220;I&#8217;m a developer evangelist. I&#8217;m often the only woman in the room, and I&#8217;M the one giving the presentation.&#8221;</p>
<p>12:35 PM PST<br />
It&#8217;s now time for Q&amp;A with the audience.  I&#8217;ve also invited members of the Twitter community to send in their questions or comments, and we&#8217;ll do our best to get them answered.  Following is a brief summary of the questions and answers provided:</p>
<p><strong>Q: </strong>First up is a father of 2 teenage girls.  He wants to know why WIT programs have continued to fall since 1985.<br />
<strong>A: </strong>WIT is a low priority for schools.  Schools have so many other priorities, and not enough time or funding, to address everything they need to.  We need intervention from outside sources to stimulate change and ensure it&#8217;s being addressed.  Rodgveller is working with her state Senator to try to enact change on the national level.</p>
<p>Moss mentions that studies show the top 2 issues for WIT are recruitment and retention.  She also points out that middle school years are very formative and important for young women to foster their interest in technology.  Rodgveller interjects that even high school is not &#8220;too late&#8221; to inspire young women.</p>
<p><strong>Q: </strong>Another father asks, how can he remove stereotypes for children?<br />
<strong>A: </strong>Parents are the best resources, period.  Parents need to support their children at home and to let them know that stereotypes are negative and not okay.  This includes not just gender issues, but also issues of race, religion, sexual orientation, etc.</p>
<p><strong>Q: </strong>Today&#8217;s youth are concerned about the technical job market in US because of the prevalence of off-shores outsourcing.  Is it still a good idea for young people to join today&#8217;s technical workforce, and how can we encourage them?<br />
<strong>A:</strong> There are still plenty of opportunities in IT.  In fact, one of the hottest trends today in technology is BI.  The best way to ensure that your job is not outsourced is to stay relevant and keep up with the newest technology; those are not the jobs that are outsourced overseas.</p>
<p><strong>Q: </strong>In the South, there are still lots of stereotypes.  For instance, women frequently are not hired by companies for technical positions.  Comments like &#8220;We can&#8217;t hire a woman for that job because it&#8217;s too valuable; what if she gets pregnant?&#8221; are still made.  What can be done about this?<br />
<strong>A:</strong> One of the executives from <a href="http://www.ca.com/us/" target="_blank">CA</a>, the sponsor of the WIT luncheon, takes the stage to answer.  He says in no uncertain terms that, at his company, those individuals making the disparaging remarks would be terminated.  He says that the type of attitude described has to come from the top down, and the company is limiting itself by not hiring women.  He ends with a message for employees to not tolerate discrimination and to go to HR whenever they see it happening.</p>
<p><strong>Q: </strong>What can parents do to help WIT?<br />
<strong>A: </strong>Parents are the greatest resource kids have.  Parents set the attitude for their kids; if your attitude is positive, it will encourage your daughter to try new things and will open her up to opportunity whenever it presents itself.  Also, parents need to raise the issue with schools, i.e. through PTA meetings, to make them realize that it&#8217;s important to you and it&#8217;s important for your children.</p>
<p>Moss: &#8220;But at the end of the day, it is the parent&#8217;s responsibility to expose your children to as much technology and as many experiences as possible.&#8221;</p>
<p>Kellenberger: &#8220;It is up to the parents to break stereotypes, for jobs, gender, race, etc. It&#8217;s the parent&#8217;s attitude that makes the difference.&#8221;</p>
<p>So that&#8217;s all I have for the Women In Technology luncheon.  There was a lot of great content and some very positive messages from our panel.  For more information on this topic, please check out the following resources:</p>
<ul>
<li><a href="http://www.sqlservercentral.com/blogs/steve_jones/archive/2009/11/04/women-in-technology-luncheon.aspx" target="_blank">Steve Jone&#8217;s musings on the WIT luncheon</a></li>
<li><a href="http://weblogs.sqlteam.com/denisem/archive/2009/11/07/61046.aspx" target="_blank">What can men do?</a> (to help WIT)</li>
<li><a href="http://www.ignite-us.org/" target="_blank">IGNITE</a></li>
</ul>
<img src="http://feeds.feedburner.com/~r/SqlFool/~4/crptoo7JmEA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sqlfool.com/2009/11/live-blogging-women-in-technology-luncheon/feed/</wfw:commentRss>
		<feedburner:origLink>http://sqlfool.com/2009/11/live-blogging-women-in-technology-luncheon/</feedburner:origLink></item>
		<item>
		<title>Live Blogging: Keynote at PASS, Day 3</title>
		<link>http://feedproxy.google.com/~r/SqlFool/~3/IPFCRjaUFWE/</link>
		<comments>http://sqlfool.com/2009/11/live-blogging-keynote-at-pass-day-3/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 17:09:12 +0000</pubDate>
		<dc:creator>Michelle Ufford</dc:creator>
		
		<category><![CDATA[PASS]]></category>

		<category><![CDATA[Syndication]]></category>

		<category><![CDATA[live blogging]]></category>

		<category><![CDATA[Summit]]></category>

		<guid isPermaLink="false">http://sqlfool.com/?p=1269</guid>
		<description><![CDATA[Today is the 3rd and final day of keynotes at the PASS Summit.  Following is highlights of the keynotes.  During the keynote, refresh often for updates!
8:36 AM PST
Keynote kicks off with Don&#8217;t Stop Believing by Journey.  Awesome.
8:38 AM PST
PASS VP of Marketing Bill Graziano just takes the stage.  He promises the [...]]]></description>
			<content:encoded><![CDATA[<p>Today is the 3rd and final day of keynotes at the PASS Summit.  Following is highlights of the keynotes.  During the keynote, refresh often for updates!</p>
<p>8:36 AM PST<br />
Keynote kicks off with Don&#8217;t Stop Believing by Journey.  Awesome.</p>
<p>8:38 AM PST<br />
PASS VP of Marketing Bill Graziano just takes the stage.  He promises the shortest keynote of the conference, and appears to deliver on it.  First up are Board announcements.</p>
<p>Outgoing Board Members are:</p>
<ul>
<li>Greg Low</li>
<li>Pat Wright (<a href="http://twitter.com/SqlAsylum" target="_blank">@sqlAsylum</a>)</li>
<li>Kevin Kline (<a href="http://twitter.com/kekline" target="_blank">@kekline</a>)</li>
</ul>
<p>If you these folks at Summit, make sure to thank them for their hard work!</p>
<p>PASS President Wayne Snyder comes out to honor and thank Kevin Kline for his 10 YEARS of service.  Yes, that&#8217;s right, 10 YEARS.  Wayne doesn&#8217;t get far into his speech before he gets choked up.  Great quote from Wayne:  &#8220;Kevin (@kekline) is a man of honor and integrity. He&#8217;s&#8230; well, he&#8217;s full of it.&#8221;  Kevin then gets a well-deserved standing ovation from the entire audience.</p>
<p>New Directors-at-Large are also announced:</p>
<ul>
<li>Brian Moran</li>
<li>Jeremiah Peschka (<a href="http://twitter.com/peschkaj" target="_blank">@peschkaj</a>)</li>
<li>Tom LaRock (<a href="http://twitter.com/SQLRockstar" target="_blank">@SQLRockstar</a>)</li>
</ul>
<p>Next year&#8217;s PASS Summit is also announced.  It will be in Seattle from November 8th - 11th, 2010. The decision was made to have the conference in Seattle because it&#8217;s a launch year, so access to Microsoft employees will be invaluable.  The registration rate is $995 if you register soon.  Details and registration can be found on the PASS site at <a href="http://www.sqlpass.org/summit/na2010" target="_blank">www.sqlpass.org/summit/na2010</a>.</p>
<p>8:52 AM PST<br />
Dell keynote just started with Patrick Ortiz, Solution Architect with Dell&#8217;s Infrastructure Consulting Services for SQL Server &amp; BI.  The keynote is pretty uneventful.</p>
<p>9:17 AM PST<br />
Woot! Dr. David DeWitt, Technical Fellow, Data &amp; Storage Platform Division at Microsoft, takes the stage.  His presentation is entitled, &#8220;From 1 to 1000 MIPS.&#8221;  He promises a very technical talk, against Microsoft Marketing&#8217;s wishes.  He&#8217;s not going to be announcing any products, but instead plans to discuss the changes in database technology and what&#8217;s in store for us in the next 10 years.</p>
<p>Highlights (or at least, the ones that my simple mind was able to grasp):</p>
<ul>
<li> Basic RDMS design is essentially unchanged, but the hardware has changed dramatically.</li>
<li>Interesting statistics in disk trends last 30 years: 10,000x capacity, 65x transfer rate, 10x avg seek time&#8230; not balanced at all</li>
<li>&#8220;CPU&#8217;s and disks are totally out-of-whack in terms of performance.&#8221;</li>
<li>The benefits of 1,000x improvement in CPU is almost negated by lack of improvement in disk</li>
<li>Transfer bandwidth/byte trends: 1980 = 0.015, in 2009 = 0.0001&#8230; 150x slower today! &#8220;It&#8217;s like trying to provide drinking water for the town through a garden hose.&#8221;</li>
<li>&#8220;Can incur up to one L2 data cache miss per row processed if row size is greater than size of cache line.&#8221;</li>
<li>DBMS transfers the ENTIRE ROW from disk to memory even though the query required just 3 attributes.</li>
<li>&#8220;Takeaway: DBMS must avoid doing random disk I/O as much as possible.&#8221;</li>
</ul>
<p>In short, DeWitt shows us the power of indexing and vertical partitioning in very technical terms. He also gives us a taste for column-oriented design, which we&#8217;ll catch a glimpse of in SQL Server 2008 R2.  Awesomeness.</p>
<p>The keynote wraps up with a promise to include DeWitt&#8217;s presentation on the Summit DVD.  If you missed the conference, then trust me, DeWitt&#8217;s presentation is worth the cost alone; all of the sessions are just a nice bonus on top of that.  <img src='http://sqlfool.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/SqlFool/~4/IPFCRjaUFWE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sqlfool.com/2009/11/live-blogging-keynote-at-pass-day-3/feed/</wfw:commentRss>
		<feedburner:origLink>http://sqlfool.com/2009/11/live-blogging-keynote-at-pass-day-3/</feedburner:origLink></item>
		<item>
		<title>Live Blogging: Keynote at PASS, Day 2</title>
		<link>http://feedproxy.google.com/~r/SqlFool/~3/7xXkM07U0Ys/</link>
		<comments>http://sqlfool.com/2009/11/live-blogging-keynote-at-pass-day-2/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 16:47:22 +0000</pubDate>
		<dc:creator>Michelle Ufford</dc:creator>
		
		<category><![CDATA[PASS]]></category>

		<category><![CDATA[Syndication]]></category>

		<category><![CDATA[Summit]]></category>

		<guid isPermaLink="false">http://sqlfool.com/?p=1243</guid>
		<description><![CDATA[So today is day 2 of the PASS Summit conference.  The conference has been excellent so far, with tons of great content and tons of great folks.  Yesterday&#8217;s keynote revealed some interesting tidbits, including SQL Server 2008 R2 setting the world record for TPC-E (transactions per second) and QphH (queries per hour).  [...]]]></description>
			<content:encoded><![CDATA[<p>So today is day 2 of the PASS Summit conference.  The conference has been excellent so far, with tons of great content and tons of great folks.  <a href="http://sqlfool.com/2009/11/live-blogging-keynote-at-pass/" target="_blank">Yesterday&#8217;s keynote</a> revealed some interesting tidbits, including SQL Server 2008 R2 setting the world record for TPC-E (transactions per second) and QphH (queries per hour).  Be sure to refresh this page frequently for updates, or <a href="http://twitter.com/#search?q=%23sqlpass" target="_blank">follow along on Twitter</a>.</p>
<p>8:00 AM PST<br />
Michelle shows up extra early today, having learned her lesson from yesterday.  Coffee in hand.  Ah, much better than yesterday.  <img src='http://sqlfool.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>8:41 AM PST<br />
Rushabh Mehta just took the stage to the tune of All Star.</p>
<p>8:46 AM PST<br />
Interesting statistics:</p>
<ul>
<li>15% reduction in revenue</li>
<li>40% growth in the SQL PASS community</li>
<li>67% reduction in IT expenses</li>
</ul>
<p>Rushabh encourages support in the PASS community.  He challenges everyone to volunteer at least an hour a month with your local user group.  If you would like to become more involved in the local East Iowa SQL Server user group, please let me know!</p>
<p>8:51 AM PST<br />
Wayne Snyder just took the stage to present the PASSion Awards.  Folks recognized include:</p>
<ul>
<li>Tim Ford (<a href="http://twitter.com/sqlagentman" target="_blank">@sqlagentman</a>) - for his work on the Program Committee and Quiz Bowl.  Tim was no where to be seen!  Probably eating left-over bagels.</li>
<li>Grant Fritchey (<a href="http://twitter.com/GFritchey" target="_blank">@GFritchey</a>) - for his contributions to getting SQL Server Standard relaunched.  Grant also had the opportunity to show off his fabulous kilt!</li>
<li>Jacob Sebastian (<a href="http://twitter.com/jacobsebastian" target="_blank">@jacobsebastian</a>) - for his contributions to the Asia community.  He has started 6 chapters in India.  Wow!  </li>
<li>Amy Lewis - for her contributions to the BI Virtual Chapters and growing the sub-chapters.</li>
</ul>
<p>9:00 AM PST<br />
2009 International PASSion Award recipient is Charlie Hanania. Accomplishments include Swiss Chapter Leader and managing the entire 2009 PASS European Conference.</p>
<p>2009 North American PASSion Award recipient is Allen Kinsel (<a href="http://twitter.com/sqlinsaneo" target="_blank">@sqlinsaneo</a>)!  Allen&#8217;s accomplishments include 5 years with PASS, and Program Manager for the 2009 Program Committee.  He helped tremendously with Summit 2009, so if you see him around Summit, be sure to thank him!</p>
<p>Read more about the PASSion Award winners <a href="http://www.sqlpass.org/AboutPASS/News/news13.aspx" target="_blank">here</a>.</p>
<p>9:07 AM PST<br />
Tom Casey just took the stage.  His first challenge is for all Summit attendees to act as agents of change in their respective organizations.  Interesting statistic: only 20% of business users have the data they need to do their job effectively.  Tom&#8217;s call to arms is to improve that statistic.</p>
<p>9:13 AM PST<br />
Tom Casey: &#8220;PASS Summit is the place to be for B-I.&#8221;  Statistics from Summit 2009: 2 dedicated BI tracks with 50+ BI-related sessions.  Last year, 20% of attendees expressed interest in BI; this year, that number is 31%.  </p>
<p>9:16 AM PST<br />
Ron VanZanten, Directing Officer of Business Intelligence for Premier Bank Card, just joined Tom on stage.  He works with over 25 TB of data and has used BI to leverage the data that they collect.  His 3,200 employees use this information to perform their job.  VanZanten wanted a flexible BI stack that would grow with the company. He&#8217;s successfully tested Madison to improve performance &#038; scale out his environment.  This is very encouraging news for any large data warehouse environment.</p>
<p>9:23 AM PST<br />
Tom recognizes that data is available in a wide variety of mediums and that the numbers of sources will only continue to increase.  He also introduces a new term: &#8220;spreadmart&#8221; - spreadsheets that are used as data marts.  </p>
<p>9:30 AM PST<br />
Amir Netz just takes the stage to give everyone a demo of the self-service BI offerings in SQL Server 2008 R2.  Features include PowerPivot and SharePoint services.  Amir shows us an Excel spreadsheet PowerPivot table with 100m rows.  It&#8217;s amazingly fast.  While I shudder to think of end users actually asking for 100m rows in Excel (and trust me, I&#8217;m sure it&#8217;ll happen), this is going to be a great breakthrough for our BI admins and our power IW users.  It&#8217;s a time saver and gives greater visibility into data.  While I realize the self-service BI offerings are still young, I&#8217;m excited for the future of BI.  I can&#8217;t wait to implement what I&#8217;ve seen in our reporting environments.</p>
<p>11:55 AM PST<br />
Tom Casey returns to center stage.  Tom announces a contest to win an X-Box 360.  To enter, follow<a href="twitter.com/powerpivot" target="_blank"> @powerpivot</a> &#038; retweet: &#8220;Want to learn more, go to http://bit.ly/4n5vpd &#038; sign up for the November CTP #powerpivot.&#8221;  Tom concludes the keynote with his call to arms to increase the number of business users who have access to the BI data that they need to do their job effectively (currently 20%).  </p>
<p>So there you have it, today&#8217;s keynote.  Check back tomorrow for details on Thursday&#8217;s keynote; it looks to be the best yet.</p>
<img src="http://feeds.feedburner.com/~r/SqlFool/~4/7xXkM07U0Ys" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sqlfool.com/2009/11/live-blogging-keynote-at-pass-day-2/feed/</wfw:commentRss>
		<feedburner:origLink>http://sqlfool.com/2009/11/live-blogging-keynote-at-pass-day-2/</feedburner:origLink></item>
		<item>
		<title>Live Blogging:  Keynote at PASS, Day 1</title>
		<link>http://feedproxy.google.com/~r/SqlFool/~3/OU1omYMVnlY/</link>
		<comments>http://sqlfool.com/2009/11/live-blogging-keynote-at-pass/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 16:50:18 +0000</pubDate>
		<dc:creator>Michelle Ufford</dc:creator>
		
		<category><![CDATA[PASS]]></category>

		<category><![CDATA[Syndication]]></category>

		<category><![CDATA[live blogging]]></category>

		<category><![CDATA[Summit]]></category>

		<guid isPermaLink="false">http://sqlfool.com/?p=1235</guid>
		<description><![CDATA[I&#8217;m honored to be invited to live-blog during the Summit keynotes.  Most of my updates will be via Twitter, but I&#8217;ll periodically consolidate and update into blog posts throughout the keynote.  Please check back frequently during the Summit for updates.
8:00 AM PST
Michelle gets situated at the blog table, running late and doesn&#8217;t even [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m honored to be invited to live-blog during the Summit keynotes.  Most of my updates will be via Twitter, but I&#8217;ll periodically consolidate and update into blog posts throughout the keynote.  Please check back frequently during the Summit for updates.</p>
<p>8:00 AM PST<br />
Michelle gets situated at the blog table, running late and doesn&#8217;t even have time for coffee.  Ack!</p>
<p>8:05 AM PST<br />
Computer finishes booting up, Twitter loaded.  Interesting statistics: 31% of folks expressed interest in Business Intelligence, up significantly from previous years.  More than 400 Microsoft product developers and managers, and 98 SQL Server MVP&#8217;s, are in attendance.</p>
<p>8:06 AM PST<br />
Wayne Snyder talks about Virtual Chapters.  Did you know there are 5 sub-chapters in the Business Intelligence virtual chapter?</p>
<p>8:07 AM PST<br />
Wayne reviews 24HoursOfPASS.  Interesting statistics: 50,123 registrations, and 3,524 folks in 70+ countries.</p>
<p>8:09 AM PST<br />
Wayne announces the return of SQL Server Standard.  The first article was posted this past week. Content is free but only available online. Seasoned SQL Server authors can earn $500 per article.  Interested parties should contact Grant Fritchey (<a href="http://twitter.com/GFritchey" target="_blank">@GFritchey</a>).</p>
<p>8:18 AM PST<br />
Closing words by Wayne:  &#8220;Remember, no one should be a stranger at Summit.&#8221;  Make sure to say &#8220;hi&#8221; to at least one person you have never met before.  The more people feel welcome, the more successful the event!  </p>
<p>8:24 AM PST<br />
I receive my first-ever press announcement and immediately start <span style="text-decoration: line-through;">leaking</span> sharing the news.  First up:  SQL Server 2008 R2 CTP scheduled for November release!  Also, looks like Madison is being rebranded as &#8220;SQL Server 2008 R2 Parallel Data Warehouse.&#8221;  I think I prefer the simplicity of &#8220;Madison.  <img src='http://sqlfool.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>8:26 AM PST<br />
Microsoft announces a new TPC-E record of 2,012 tpsE.  This is a platform-independent world record for *any* OLTP system. Oracle, eat your heart out.</p>
<p>8:30 AM PST<br />
More details on the TPC-E benchmark world record: Unisys ES7000 model 7600R Enterprise Server on 96-core Xeon platform (first server with &gt;64 cores).  The same Unisys server also reached 102,778 QphH (queries per hour), a data warehousing performance improvement of 70%.</p>
<p>8:39 AM PST<br />
Bob tells us that the IO strain on virtualized machines is there but negated by Hyper-V.  We&#8217;re given a demo of live migration: it appears that migration is seamless and that transactions are unaffected by the process.  Very cool.</p>
<p>8:42 AM PST<br />
Bob talks about the future of SQL Server as more companies move toward the cloud.</p>
<p>8:50 AM PST<br />
Bob concludes his speech by discussing the future of the data professional, and how the DBA role will not become obsolete but merely transformed.</p>
<p>8:52 AM PST<br />
Ted Kummert, Senior VP of SQL Server, takes the stage.</p>
<p>8:56 AM PST<br />
Ted&#8217;s Top 5 Reasons to be at PASS Summit:</p>
<p style="padding-left: 30px;">#1 You are part of the world&#8217;s largest gathering of SQL Server professionals<br />
#2 You can take your questions directly to the &#8220;source&#8221;<br />
#3 We&#8217;ve got Wayne and Rushabh<br />
#4 You can work hard and PLAY hard<br />
#5 You will build skills &amp; knowledge on the #1 <em>database in the world</em></p>
<p>9:16 AM PST<br />
Dan Jones, Principle Group Program Manager for SQL Server Manageability, takes the stage.</p>
<p>9:20 AM PST<br />
Dan gives us a demo of SQL Server 2008 R2, including Utility Control Points.  </p>
<p>9:30 AM PST<br />
I need to leave to check in for my 10:30 am presentation.  Bummed I&#8217;m going to miss the last of the keynote.  <img src='http://sqlfool.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/SqlFool/~4/OU1omYMVnlY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sqlfool.com/2009/11/live-blogging-keynote-at-pass/feed/</wfw:commentRss>
		<feedburner:origLink>http://sqlfool.com/2009/11/live-blogging-keynote-at-pass/</feedburner:origLink></item>
		<item>
		<title>#PASSAwesomeness</title>
		<link>http://feedproxy.google.com/~r/SqlFool/~3/01z_j_1L7xo/</link>
		<comments>http://sqlfool.com/2009/10/passawesomeness/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 01:39:22 +0000</pubDate>
		<dc:creator>Michelle Ufford</dc:creator>
		
		<category><![CDATA[Miscellaneous]]></category>

		<category><![CDATA[PASS]]></category>

		<category><![CDATA[Performance & Tuning]]></category>

		<category><![CDATA[Presentations]]></category>

		<category><![CDATA[Syndication]]></category>

		<category><![CDATA[380PASS]]></category>

		<category><![CDATA[performance]]></category>

		<category><![CDATA[Summit]]></category>

		<category><![CDATA[Super Bowl]]></category>

		<category><![CDATA[VLDB]]></category>

		<guid isPermaLink="false">http://sqlfool.com/?p=1202</guid>
		<description><![CDATA[Allen Kinsel on Twitter (@sqlinsaneo) recently started a new Twitter tag, #PASSAwesomeness, about all of the cool things about PASS Summit.  I really like the tag, so I&#8217;m going to blatantly steal borrow it for this post.   
First, and long overdue, I want to give a brief recap of the East Iowa [...]]]></description>
			<content:encoded><![CDATA[<p>Allen Kinsel on Twitter (<a href="http://twitter.com/sqlinsaneo" target="_blank">@sqlinsaneo</a>) recently started a new Twitter tag, <a href="http://twitter.com/#search?q=%23passawesomeness" target="_blank">#PASSAwesomeness</a>, about all of the cool things about <a href="http://summit2009.sqlpass.org" target="_blank">PASS Summit</a>.  I really like the tag, so I&#8217;m going to <span style="text-decoration: line-through;">blatantly steal</span> borrow it for this post.  <img src='http://sqlfool.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>First, and long overdue, I want to give a brief recap of the <a href="http://sqlsaturday.380pass.org" target="_blank">East Iowa SQL Saturday</a>.  On October 17th, our local PASS chapter, <a href="http://380pass.org" target="_blank">380PASS</a>, sponsored our first ever SQL Saturday at the University of Iowa in Iowa City.  By all accounts, the event was a great success!  We had 90 attendees, 11 speakers, and 21 sessions.  We received numerous compliments on the quality of the speakers, the niceness of the facilities, and the abundance of food.  Not too shabby for our first time hosting the event, if I do say so myself.  <img src='http://sqlfool.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I&#8217;d like to thank all of our wonderful speakers, especially those who traveled from out of town and out of state, for making this event such a success.  I&#8217;d also like to thank our amazing volunteers for helping put this all together.  Lastly, but certainly not least, I&#8217;d like to thank our generous sponsors, without whom this event would not be possible.  Because this event went so smoothly and was so well received in the community, we&#8217;ve already started planning our next big SQL event!  In the meantime, don&#8217;t forget to check out our monthly <a href="http://380pass.org" target="_blank">380PASS</a> meetings to tide you over.  </p>
<p>I&#8217;d also like to take a moment to discuss the <a href="http://summit2009.sqlpass.org/" target="_blank">PASS Summit</a>.  Unless you&#8217;re a DBA who&#8217;s been living under a rock, you&#8217;ve probably heard of the PASS Summit.  If you *have* been living under a rock &#8212; and hey, I&#8217;m not poking fun, I used to live under a rock, too!  &#8212; then what you need to know is that the Summit is the largest SQL Server conference in the world.  It&#8217;s a gathering of Microsoft developers and SQL Server gurus; the rest of us show up to try to absorb as much from them as possible.  Since I&#8217;ve <a href="http://sqlfool.com/2009/08/getting-started-with-variables-in-ssis/" target="_blank">recently moved to the Business Intelligence team</a>, I&#8217;m extremely excited to delve into the <a href="http://summit2009.sqlpass.org/Agenda/ProgramSessions.aspx" target="_blank">amazing amount of BI content offered</a>.</p>
<p>I&#8217;m also deeply honored to be presenting at the Summit this year on some of the performance tuning techniques I&#8217;ve used with great success in my production environments.  The session is titled, <a href="http://summit2009.sqlpass.org/Agenda/ProgramSessions/SuperBowlSuperLoadALookatPerformance.aspx" target="_blank">Super Bowl, Super Load - A Look At Performance Tuning for VLDB&#8217;s</a>.  If you&#8217;re interested in performance tuning or VLDB (very large database) topics, consider stopping by to catch my session.  From what I can tell, I&#8217;ll be presenting on Tuesday from 10:15am - 11:30am in room(s?) 602-604.  </p>
<p>If you read my blog, or if we&#8217;ve ever interacted in any way on the internet &#8212; <a href="http://twitter.com/sqlfool" target="_blank">Twitter</a>, LinkedIn, e-mails, blog comments, etc. &#8212; please stop by and say &#8220;hi&#8221;!  Aside from all of the awesome SQL Server content, I&#8217;m really looking forward to meeting as many new folks as possible.  </p>
<p>And on that note&#8230; </p>
<p>Getting to meet all of the amazing SQL Server professionals out there who have inspired and encouraged me in so many ways <a href="http://twitter.com/#search?q=%23passawesomeness" target="_blank">#PASSAwesomeness</a></p>
<img src="http://feeds.feedburner.com/~r/SqlFool/~4/01z_j_1L7xo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sqlfool.com/2009/10/passawesomeness/feed/</wfw:commentRss>
		<feedburner:origLink>http://sqlfool.com/2009/10/passawesomeness/</feedburner:origLink></item>
		<item>
		<title>Partitioning Tricks</title>
		<link>http://feedproxy.google.com/~r/SqlFool/~3/2rOUqpjiQpA/</link>
		<comments>http://sqlfool.com/2009/10/partitioning-tricks/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 19:12:35 +0000</pubDate>
		<dc:creator>Michelle Ufford</dc:creator>
		
		<category><![CDATA[Miscellaneous]]></category>

		<category><![CDATA[Performance & Tuning]]></category>

		<category><![CDATA[SQL 2008]]></category>

		<category><![CDATA[SQL Tips]]></category>

		<category><![CDATA[Syndication]]></category>

		<category><![CDATA[2008]]></category>

		<category><![CDATA[compression]]></category>

		<category><![CDATA[partitioning]]></category>

		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://sqlfool.com/?p=1195</guid>
		<description><![CDATA[For those of you who are using partitioning, or who are considering using partitioning, allow me to share some tips with you.
Easy Partition Staging Tables
Switching partitions (or more specifically, hobts) in and out of a partitioned table requires the use of a staging table.  The staging table has very specific requirements: it must be [...]]]></description>
			<content:encoded><![CDATA[<p>For those of you who are using partitioning, or who are considering using partitioning, allow me to share some tips with you.</p>
<p><strong>Easy Partition Staging Tables</strong></p>
<p>Switching partitions (or more specifically, hobts) in and out of a partitioned table requires the use of a staging table.  The staging table has very specific requirements: it must be completely identical to the partitioned table, including indexing structures, and it must have a check constraint that limits data to the partitioning range.  Thanks to my co-worker Jeff, I&#8217;ve recently started using the <a href="http://sqlpartitionmgmt.codeplex.com/" target="_blank">SQL Server Partition Management</a> tool on CodePlex.  I haven&#8217;t used the automatic partition switching feature &#8212; frankly, using any sort of data modification tool in a production environment makes me nervous &#8212; but I&#8217;ve been using the scripting option to create staging tables in my development environment, which I then copy to production for use.  It&#8217;s nothing you can&#8217;t do yourself, but it does make the whole process easy and painless, plus it saves you from annoying typos.  But be careful when using this tool to just create the table and check constraints automatically, because you may need to&#8230;</p>
<p><strong>Add Check Constraints After Loading Data</strong></p>
<p>Most of the time, I add the check constraint when I create the staging table, then I load data and perform the partition switch.  However, for some reason, I was receiving the following error:</p>
<p><span style="color: #ff0000;">.Net SqlClient Data Provider: Msg 4972, Level 16, State 1, Line 1<br />
ALTER TABLE SWITCH statement failed. Check constraints or partition function of source table &#8216;myStagingTable&#8217; allows values that are not allowed by check constraints or partition function on target table &#8216;myDestinationTable&#8217;.</span></p>
<p>This drove me crazy.  I confirmed my check constraints were correct, that I had the correct partition number, and that all schema and indexes matched identically.  After about 30 minutes of this, I decided to drop and recreate the constraint.  For some reason, it fixed the issue.  Repeat tests produced the same results:  the check constraint needed to be added *after* data was loaded.  This error is occurring on a SQL Server 2008 SP1 box; to be honest, I&#8217;m not sure what&#8217;s causing the error, so if you know, please leave me a comment.  But I figured I&#8217;d share so that anyone else running into this issue can hopefully save some time and headache.  <img src='http://sqlfool.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Replicating Into Partitioned and Non-Partitioned Tables</strong></p>
<p>Recently, we needed to replicate a non-partitioned table to two different destinations.  We wanted to use partitioning for Server A, which has 2008 Enterprise; Server B, which is on 2005 Standard, could not take advantage of partitioning.  The solution was really easy:  create a pre-snapshot and post-snapshot script for the publication, then modify to handle each server group differently.  Using pseudo-code, it looked something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #008080;">/* Identify which servers get the partitioned version */</span>
<span style="color: #0000FF;">IF</span> <span style="color: #FF00FF;">@@SERVERNAME</span> In <span style="color: #808080;">&#40;</span><span style="color: #FF0000;">'yourServerNameList'</span><span style="color: #808080;">&#41;</span> 
<span style="color: #0000FF;">BEGIN</span>
&nbsp;
    <span style="color: #008080;">/* Create your partitioning scheme if necessary */</span>
    <span style="color: #0000FF;">IF</span> Not Exists<span style="color: #808080;">&#40;</span><span style="color: #0000FF;">SELECT</span> <span style="color: #808080;">*</span> <span style="color: #0000FF;">FROM</span> sys.<span style="color: #202020;">partition_schemes</span> <span style="color: #0000FF;">WHERE</span> name <span style="color: #808080;">=</span> <span style="color: #FF0000;">'InsertPartitionScheme'</span><span style="color: #808080;">&#41;</span>
        <span style="color: #0000FF;">CREATE</span> PARTITION SCHEME InsertPartitionScheme 
            <span style="color: #0000FF;">AS</span> PARTITION InsertPartitionFunction <span style="color: #808080;">ALL</span> <span style="color: #0000FF;">TO</span> <span style="color: #808080;">&#40;</span><span style="color: #808080;">&#91;</span><span style="color: #0000FF;">PRIMARY</span><span style="color: #808080;">&#93;</span><span style="color: #808080;">&#41;</span>;    
&nbsp;
    <span style="color: #008080;">/* Create your partitioning function if necessary */</span>
    <span style="color: #0000FF;">IF</span> Not Exists<span style="color: #808080;">&#40;</span><span style="color: #0000FF;">SELECT</span> <span style="color: #808080;">*</span> <span style="color: #0000FF;">FROM</span> sys.<span style="color: #202020;">partition_functions</span> <span style="color: #0000FF;">WHERE</span> name <span style="color: #808080;">=</span> <span style="color: #FF0000;">'InsertPartitionFunction'</span><span style="color: #808080;">&#41;</span>
        <span style="color: #0000FF;">CREATE</span> PARTITION <span style="color: #0000FF;">FUNCTION</span> InsertPartitionFunction <span style="color: #808080;">&#40;</span><span style="color: #0000FF;">SMALLDATETIME</span><span style="color: #808080;">&#41;</span> 
            <span style="color: #0000FF;">AS</span> RANGE <span style="color: #0000FF;">RIGHT</span> <span style="color: #0000FF;">FOR</span> <span style="color: #0000FF;">VALUES</span> <span style="color: #808080;">&#40;</span><span style="color: #FF0000;">'insertValues'</span><span style="color: #808080;">&#41;</span>;    
&nbsp;
    <span style="color: #008080;">/* Create a partitioned version of your table */</span>
    <span style="color: #0000FF;">CREATE</span> <span style="color: #0000FF;">TABLE</span> <span style="color: #808080;">&#91;</span>dbo<span style="color: #808080;">&#93;</span>.<span style="color: #808080;">&#91;</span>yourTableName<span style="color: #808080;">&#93;</span> <span style="color: #808080;">&#40;</span>
	    <span style="color: #808080;">&#91;</span>yourTableSchema<span style="color: #808080;">&#93;</span>
    <span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">ON</span> InsertPartitionScheme<span style="color: #808080;">&#40;</span><span style="color: #808080;">&#91;</span>partitioningKey<span style="color: #808080;">&#93;</span><span style="color: #808080;">&#41;</span>;
&nbsp;
<span style="color: #0000FF;">END</span>
<span style="color: #0000FF;">ELSE</span>
<span style="color: #0000FF;">BEGIN</span>
&nbsp;
    <span style="color: #008080;">/* Create a non-partitioned version of your table */</span>
    <span style="color: #0000FF;">CREATE</span> <span style="color: #0000FF;">TABLE</span> <span style="color: #808080;">&#91;</span>dbo<span style="color: #808080;">&#93;</span>.<span style="color: #808080;">&#91;</span>yourTableName<span style="color: #808080;">&#93;</span> <span style="color: #808080;">&#40;</span>
	    <span style="color: #808080;">&#91;</span>yourTableSchema<span style="color: #808080;">&#93;</span>
    <span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">ON</span> <span style="color: #808080;">&#91;</span><span style="color: #0000FF;">PRIMARY</span><span style="color: #808080;">&#93;</span>;
&nbsp;
<span style="color: #0000FF;">END</span></pre></div></div>

<p>You could also use an edition check instead of a server name check, if you prefer.  The post-snapshot script basically looked the same, except you create partitioned indexes instead.</p>
<p><strong>Compress Old Partitions</strong></p>
<p>Did you know you can set different compression levels for individual partitions?  It&#8217;s true!  I&#8217;ve just completed doing this on our largest partitioned table.  Here&#8217;s how:</p>

<div class="wp_syntax"><div class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #008080;">/* Apply compression to your partitioned table */</span>
<span style="color: #0000FF;">ALTER</span> <span style="color: #0000FF;">TABLE</span> dbo.<span style="color: #202020;">yourTableName</span>
Rebuild Partition <span style="color: #808080;">=</span> All
<span style="color: #0000FF;">WITH</span> 
<span style="color: #808080;">&#40;</span>
      Data_Compression <span style="color: #808080;">=</span> Page <span style="color: #0000FF;">ON</span> Partitions<span style="color: #808080;">&#40;</span><span style="color: #000;">1</span> <span style="color: #0000FF;">TO</span> <span style="color: #000;">9</span><span style="color: #808080;">&#41;</span>
    , Data_Compression <span style="color: #808080;">=</span> <span style="color: #0000FF;">ROW</span>  <span style="color: #0000FF;">ON</span> Partitions<span style="color: #808080;">&#40;</span><span style="color: #000;">10</span> <span style="color: #0000FF;">TO</span> <span style="color: #000;">11</span><span style="color: #808080;">&#41;</span> 
    , Data_Compression <span style="color: #808080;">=</span> <span style="color: #0000FF;">NONE</span> <span style="color: #0000FF;">ON</span> Partitions<span style="color: #808080;">&#40;</span><span style="color: #000;">12</span><span style="color: #808080;">&#41;</span>
<span style="color: #808080;">&#41;</span>;
&nbsp;
<span style="color: #008080;">/* Apply compression to your partitioned index */</span>
<span style="color: #0000FF;">ALTER</span> <span style="color: #0000FF;">INDEX</span> YourPartitionedIndex
    <span style="color: #0000FF;">ON</span> dbo.<span style="color: #202020;">yourTableName</span>
    Rebuild Partition <span style="color: #808080;">=</span> All
    <span style="color: #0000FF;">WITH</span> 
    <span style="color: #808080;">&#40;</span>
      Data_Compression <span style="color: #808080;">=</span> Page <span style="color: #0000FF;">ON</span> Partitions<span style="color: #808080;">&#40;</span><span style="color: #000;">1</span> <span style="color: #0000FF;">TO</span> <span style="color: #000;">9</span><span style="color: #808080;">&#41;</span>
    , Data_Compression <span style="color: #808080;">=</span> <span style="color: #0000FF;">ROW</span>  <span style="color: #0000FF;">ON</span> Partitions<span style="color: #808080;">&#40;</span><span style="color: #000;">10</span> <span style="color: #0000FF;">TO</span> <span style="color: #000;">11</span><span style="color: #808080;">&#41;</span> 
    , Data_Compression <span style="color: #808080;">=</span> <span style="color: #0000FF;">NONE</span> <span style="color: #0000FF;">ON</span> Partitions<span style="color: #808080;">&#40;</span><span style="color: #000;">12</span><span style="color: #808080;">&#41;</span>
    <span style="color: #808080;">&#41;</span>;
&nbsp;
<span style="color: #008080;">/* Apply compression to your unpartitioned index */</span>
<span style="color: #0000FF;">ALTER</span> <span style="color: #0000FF;">INDEX</span> YourUnpartitionedIndex
    <span style="color: #0000FF;">ON</span> dbo.<span style="color: #202020;">yourTableName</span>
    Rebuild <span style="color: #0000FF;">WITH</span> <span style="color: #808080;">&#40;</span>Data_Compression <span style="color: #808080;">=</span> <span style="color: #0000FF;">ROW</span><span style="color: #808080;">&#41;</span>;</pre></div></div>

<p>A couple of things to note.  In all of our proof-of-concept testing, we found that compression significantly reduced query execution time, reads (IO), and storage.  However, CPU was also increased significantly.  The results were more dramatic, both good and bad, with page compression versus row compression.  Still, for our older partitions, which aren&#8217;t queried regularly, it made sense to turn on page compression.  The newer partitions receive row compression, and the newest partitions, which are still queried very regularly by routine processes, were left completely uncompressed.  This seems to strike a nice balance in our environment, but of course, results will vary depending on how you use your data.</p>
<p>Something to be aware of is that compressing your clustered index does *not* compress your non-clustered indexes; those are separate operations.  Lastly, for those who are curious, it took us about 1 minute to apply row compression and about 7 minutes to apply page compression to partitions averaging 30 million rows.</p>
<p>Looking for more information on table partitioning?  Check out my <a href="http://sqlfool.com/2008/11/partitioning-101/" target="_blank">overview of partitioning</a>, my <a href="http://sqlfool.com/2008/11/102/" target="_blank">example code</a>, and my article on <a href="http://sqlfool.com/2008/12/indexing-for-partitioned-tables/" target="_blank">indexing on partitioned tables</a>.</p>
<img src="http://feeds.feedburner.com/~r/SqlFool/~4/2rOUqpjiQpA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sqlfool.com/2009/10/partitioning-tricks/feed/</wfw:commentRss>
		<feedburner:origLink>http://sqlfool.com/2009/10/partitioning-tricks/</feedburner:origLink></item>
		<item>
		<title>Why I’m Blogging Less</title>
		<link>http://feedproxy.google.com/~r/SqlFool/~3/l_9yEQvpToo/</link>
		<comments>http://sqlfool.com/2009/10/why-im-blogging-less/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 14:50:35 +0000</pubDate>
		<dc:creator>Michelle Ufford</dc:creator>
		
		<category><![CDATA[Business Intelligence]]></category>

		<category><![CDATA[Miscellaneous]]></category>

		<category><![CDATA[PASS]]></category>

		<category><![CDATA[Presentations]]></category>

		<category><![CDATA[Syndication]]></category>

		<category><![CDATA[380PASS]]></category>

		<category><![CDATA[events]]></category>

		<category><![CDATA[presentation]]></category>

		<category><![CDATA[SQL Saturday]]></category>

		<guid isPermaLink="false">http://sqlfool.com/?p=1174</guid>
		<description><![CDATA[I&#8217;ve received a few questions asking why I&#8217;ve been blogging less frequently, and even one inquiry after my health.  Rest assured, I&#8217;m completely fine.  But there are 2 perfectly good reasons why I&#8217;ve been blogging less these days.
East Iowa SQL Saturday:
I&#8217;m the event organizer for East Iowa SQL Saturday, which is eating up [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve received a few questions asking why I&#8217;ve been blogging less frequently, and even one inquiry after my health.  Rest assured, I&#8217;m completely fine.  But there are 2 perfectly good reasons why I&#8217;ve been blogging less these days.</p>
<p><strong>East Iowa SQL Saturday:</strong></p>
<p>I&#8217;m the event organizer for <a href="http://sqlsaturday.380pass.org" target="_blank">East Iowa SQL Saturday</a>, which is eating up a lot of my free time.  If you haven&#8217;t yet heard about our SQL Saturday event, let me give you a brief overview.  It&#8217;s a FREE, one-day training event geared toward SQL Server professionals and anyone who wants to learn more about SQL Server.  We have 22 sessions planned covering a variety of topics, from Business Intelligence to Disaster Recovery to SQL Server 2008 topics.  And if you&#8217;re a .NET developer, we also have some .NET-related presentations, including PowerShell and MVC.</p>
<p>We&#8217;re very fortunate to have snagged an excellent set of speakers.  <a href="http://jessicammoss.blogspot.com/" target="_blank">Jessica Moss</a>, <a href="http://sqlblog.com/blogs/louis_davidson/default.aspx" target="_blank">Louis Davidson</a>, <a href="http://www.ford-it.com/sqlagentman/" target="_blank">Timothy Ford</a>, <a href="http://stratesql.com/" target="_blank">Jason Strate</a>, and <a href="http://www.simple-talk.com/author/alex-kuznetsov/" target="_blank">Alex Kuznetsov</a> are just a few of the great speakers we have lined up.</p>
<p style="text-align: left;">There&#8217;s only a handful of spots left, so if you&#8217;re interested in attending, you should register soon.  To find out more details about the speakers and sessions, or to register, be sure to check out our website at <a href="http://sqlsaturday.380pass.org" target="_blank">http://sqlsaturday.380pass.org</a>.</p>
<p><strong>The Other Reason:</strong></p>
<p><a href="http://sqlfool.com/wp-content/uploads/2009/10/baby_uff.jpg"><img class="aligncenter size-medium wp-image-1177" title="baby_uff" src="http://sqlfool.com/wp-content/uploads/2009/10/baby_uff-300x219.jpg" alt="baby_uff" width="300" height="219" /></a></p>
<p>Yes, that&#8217;s right, I&#8217;m with child.  Expecting.  Eating for two.  Bun in the oven.  In the family way.  You get the idea.</p>
<p>So when I&#8217;m not at work, planning SQL Saturday, or playing <a href="http://www.civilizationrevolution.com/" target="_blank">Civilization Revolution</a>, I&#8217;m sleeping.  For those who remotely care, I&#8217;m due around Super Bowl time in February 2010.  </p>
<div class="wp-caption aligncenter" style="width: 310px"><img alt="2010: The Year I Make Contact" src="http://www.thespacereview.com/archive/1310a.jpg" title="2010: The Year I Make Contact" width="80%" height="80%" /><p class="wp-caption-text">2010: The Year I Make Contact</p></div>
<p>Rest assured, this blog isn&#8217;t going away.  And hopefully once I get through <a href="http://sqlsaturday.380pass.org" target="_blank">SQL Saturday</a> and then <a href="http://summit2009.sqlpass.org" target="_blank">PASS Summit</a>, I&#8217;ll have more free time again.  <img src='http://sqlfool.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/SqlFool/~4/l_9yEQvpToo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sqlfool.com/2009/10/why-im-blogging-less/feed/</wfw:commentRss>
		<feedburner:origLink>http://sqlfool.com/2009/10/why-im-blogging-less/</feedburner:origLink></item>
		<item>
		<title>Monitoring Process for Performance Counters</title>
		<link>http://feedproxy.google.com/~r/SqlFool/~3/mNmzwj4VXcg/</link>
		<comments>http://sqlfool.com/2009/09/monitoring-process-for-performance-counters/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 17:19:12 +0000</pubDate>
		<dc:creator>Michelle Ufford</dc:creator>
		
		<category><![CDATA[Performance & Tuning]]></category>

		<category><![CDATA[Syndication]]></category>

		<category><![CDATA[T-SQL Scripts]]></category>

		<category><![CDATA[monitor]]></category>

		<category><![CDATA[performance]]></category>

		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://sqlfool.com/?p=1161</guid>
		<description><![CDATA[Recently I needed to create a process to monitor performance counters over a short period of time.  We were going to implement a change and we wanted to compare performance before and after to see if there was any impact.  
To do this, I first created a couple of tables.  One table [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I needed to create a process to monitor performance counters over a short period of time.  We were going to implement a change and we wanted to compare performance before and after to see if there was any impact.  </p>
<p>To do this, I first created a couple of tables.  One table is used to actually store the monitored values.  The second table is used for configuration; you insert only the counters you want to monitor.</p>

<div class="wp_syntax"><div class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #008080;">/* Create the table to store our logged perfmon counters */</span>
<span style="color: #0000FF;">CREATE</span> <span style="color: #0000FF;">TABLE</span> dbo.<span style="color: #202020;">dba_perfCounterMonitor</span>
<span style="color: #808080;">&#40;</span>
      capture_id    <span style="color: #0000FF;">INT</span> <span style="color: #0000FF;">IDENTITY</span><span style="color: #808080;">&#40;</span><span style="color: #000;">1</span>,<span style="color: #000;">1</span><span style="color: #808080;">&#41;</span>   Not Null
    , captureDate   <span style="color: #0000FF;">SMALLDATETIME</span>       Not Null
    , objectName    <span style="color: #0000FF;">NVARCHAR</span><span style="color: #808080;">&#40;</span><span style="color: #000;">128</span><span style="color: #808080;">&#41;</span>       Not Null
    , counterName   <span style="color: #0000FF;">NVARCHAR</span><span style="color: #808080;">&#40;</span><span style="color: #000;">128</span><span style="color: #808080;">&#41;</span>       Not Null
    , instanceName  <span style="color: #0000FF;">NVARCHAR</span><span style="color: #808080;">&#40;</span><span style="color: #000;">128</span><span style="color: #808080;">&#41;</span>       Not Null
    , <span style="color: #0000FF;">VALUE</span>         <span style="color: #0000FF;">FLOAT</span><span style="color: #808080;">&#40;</span><span style="color: #000;">6</span><span style="color: #808080;">&#41;</span>            Not Null
    , valueType     <span style="color: #0000FF;">NVARCHAR</span><span style="color: #808080;">&#40;</span><span style="color: #000;">10</span><span style="color: #808080;">&#41;</span>        Not Null
&nbsp;
    <span style="color: #0000FF;">CONSTRAINT</span> PK_dba_perfCounterMonitor
        <span style="color: #0000FF;">PRIMARY</span> <span style="color: #0000FF;">KEY</span> <span style="color: #0000FF;">CLUSTERED</span><span style="color: #808080;">&#40;</span>capture_id<span style="color: #808080;">&#41;</span>
<span style="color: #808080;">&#41;</span>;
&nbsp;
<span style="color: #008080;">/* Create the table that controls which counters we're going to monitor */</span>
<span style="color: #0000FF;">CREATE</span> <span style="color: #0000FF;">TABLE</span> dbo.<span style="color: #202020;">dba_perfCounterMonitorConfig</span>
<span style="color: #808080;">&#40;</span>
      objectName    <span style="color: #0000FF;">NVARCHAR</span><span style="color: #808080;">&#40;</span><span style="color: #000;">128</span><span style="color: #808080;">&#41;</span>   Not Null
    , counterName   <span style="color: #0000FF;">NVARCHAR</span><span style="color: #808080;">&#40;</span><span style="color: #000;">128</span><span style="color: #808080;">&#41;</span>   Not Null
    , instanceName  <span style="color: #0000FF;">NVARCHAR</span><span style="color: #808080;">&#40;</span><span style="color: #000;">128</span><span style="color: #808080;">&#41;</span>   Null
<span style="color: #808080;">&#41;</span>;</pre></div></div>

<p>If you leave the instanceName NULL in the config table, it&#8217;ll monitor all instances.  Now we&#8217;re going to insert some sample performance counters into the config table.  The counters you&#8217;re interested in can, and likely will, vary.</p>

<div class="wp_syntax"><div class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #008080;">/* Insert some perfmon counters to be monitored */</span>
<span style="color: #0000FF;">INSERT</span> <span style="color: #0000FF;">INTO</span> dbo.<span style="color: #202020;">dba_perfCounterMonitorConfig</span>
<span style="color: #0000FF;">SELECT</span> <span style="color: #FF0000;">'SQLServer:Buffer Manager'</span>, <span style="color: #FF0000;">'Page Life Expectancy'</span>, Null <span style="color: #0000FF;">UNION</span> All
<span style="color: #0000FF;">SELECT</span> <span style="color: #FF0000;">'SQLServer:Locks'</span>, <span style="color: #FF0000;">'Lock Requests/sec'</span>, Null <span style="color: #0000FF;">UNION</span> All
<span style="color: #0000FF;">SELECT</span> <span style="color: #FF0000;">'SQLServer:Locks'</span>, <span style="color: #FF0000;">'Lock Waits/sec'</span>, Null <span style="color: #0000FF;">UNION</span> All
<span style="color: #0000FF;">SELECT</span> <span style="color: #FF0000;">'SQLServer:Locks'</span>, <span style="color: #FF0000;">'Lock Wait Time (ms)'</span>, Null <span style="color: #0000FF;">UNION</span> All
<span style="color: #0000FF;">SELECT</span> <span style="color: #FF0000;">'SQLServer:Buffer Manager'</span>, <span style="color: #FF0000;">'Page reads/sec'</span>, Null <span style="color: #0000FF;">UNION</span> All
<span style="color: #0000FF;">SELECT</span> <span style="color: #FF0000;">'SQLServer:Buffer Manager'</span>, <span style="color: #FF0000;">'Page writes/sec'</span>, Null <span style="color: #0000FF;">UNION</span> All
<span style="color: #0000FF;">SELECT</span> <span style="color: #FF0000;">'SQLServer:Buffer Manager'</span>, <span style="color: #FF0000;">'Buffer cache hit ratio'</span>, Null <span style="color: #0000FF;">UNION</span> All
<span style="color: #0000FF;">SELECT</span> <span style="color: #FF0000;">'SQLServer:Databases'</span>, <span style="color: #FF0000;">'Transactions/sec'</span>, <span style="color: #FF0000;">'AdventureWorks'</span> <span style="color: #0000FF;">UNION</span> All
<span style="color: #0000FF;">SELECT</span> <span style="color: #FF0000;">'SQLServer:General Statistics'</span>, <span style="color: #FF0000;">'Processes blocked'</span>, Null;</pre></div></div>

<p>Now let&#8217;s create our proc.  This proc will run for a specified time period and will *average* the counters over that time.  I personally take snapshots every 15 seconds for 4 minutes; I have a scheduled task that runs this every 5 minutes.  It&#8217;s not perfect, but it gives me a good idea of what&#8217;s happening on the server.</p>

<div class="wp_syntax"><div class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #0000FF;">CREATE</span> <span style="color: #0000FF;">PROCEDURE</span> dbo.<span style="color: #202020;">dba_perfCounterMonitor_sp</span>
&nbsp;
        <span style="color: #008080;">/* Declare Parameters */</span>
          @samplePeriod    <span style="color: #0000FF;">INT</span>      <span style="color: #808080;">=</span>  <span style="color: #000;">240</span>  <span style="color: #008080;">/* how long to sample, in seconds */</span>
        , @sampleRate      <span style="color: #0000FF;">CHAR</span><span style="color: #808080;">&#40;</span><span style="color: #000;">8</span><span style="color: #808080;">&#41;</span>  <span style="color: #808080;">=</span>  <span style="color: #FF0000;">'00:00:15'</span>  <span style="color: #008080;">/* how frequently to sample, in seconds */</span>
        , @displayResults  <span style="color: #0000FF;">BIT</span>      <span style="color: #808080;">=</span>  <span style="color: #000;">0</span>  <span style="color: #008080;">/* display the results when done */</span>
<span style="color: #0000FF;">AS</span>
<span style="color: #008080;">/*********************************************************************************
    Name:       dba_perfCounterMonitor_sp
&nbsp;
    Author:     Michelle Ufford, http://sqlfool.com
&nbsp;
    Purpose:    Monitors performance counters.  Uses the dba_perfCounterMonitorConfig
                table to manage which perf counters to monitor.  
&nbsp;
                @samplePeriod - specifies how long the process will try to monitor
                                performance counters; in seconds.
&nbsp;
                @sampleRate - how long inbetween samples; in seconds.
&nbsp;
                The average values over sample period is then logged to the
                dba_perfCounterMonitor table.
&nbsp;
    Notes:      There are 3 basic types of performance counter calculations:
&nbsp;
                Value/Base: these calculations require 2 counters. The value 
                            counter (cntr_type = 537003264) has to be divided 
                            by the base counter (cntr_type = 1073939712).
&nbsp;
                Per Second: these counters are store cumulative values; the
                            value must be compared at 2 different times to
                            calculate the difference (cntr_type = 537003264).
&nbsp;
                Point In Time:  these counters show what the value of the
                                counter is at the current point-in-time 
                                (cntr_type = 65792).  No calculation is 
                                necessary to derive the value.
&nbsp;
    Called by:  DBA
&nbsp;
    Date        User    Description
    ----------------------------------------------------------------------------
    2009-09-04  MFU     Initial Release
*********************************************************************************
    Exec dbo.dba_perfCounterMonitor_sp
          @samplePeriod     = 60
        , @sampleRate       = '00:00:01'
        , @displayResults   = 1;
*********************************************************************************/</span>
&nbsp;
<span style="color: #0000FF;">SET</span> <span style="color: #0000FF;">NOCOUNT</span> <span style="color: #0000FF;">ON</span>;
<span style="color: #0000FF;">SET</span> XACT_Abort <span style="color: #0000FF;">ON</span>;
<span style="color: #0000FF;">SET</span> Ansi_Padding <span style="color: #0000FF;">ON</span>;
<span style="color: #0000FF;">SET</span> Ansi_Warnings <span style="color: #0000FF;">ON</span>;
<span style="color: #0000FF;">SET</span> ArithAbort <span style="color: #0000FF;">ON</span>;
<span style="color: #0000FF;">SET</span> Concat_Null_Yields_Null <span style="color: #0000FF;">ON</span>;
<span style="color: #0000FF;">SET</span> Numeric_RoundAbort <span style="color: #0000FF;">OFF</span>;
&nbsp;
<span style="color: #0000FF;">BEGIN</span>
&nbsp;
    <span style="color: #008080;">/* Declare Variables */</span>
    <span style="color: #0000FF;">DECLARE</span> @startTime <span style="color: #0000FF;">DATETIME</span>
        , @endTime <span style="color: #0000FF;">DATETIME</span>
        , @iteration <span style="color: #0000FF;">INT</span>;
&nbsp;
    <span style="color: #0000FF;">SELECT</span> @startTime <span style="color: #808080;">=</span> <span style="color: #FF00FF;">GETDATE</span><span style="color: #808080;">&#40;</span><span style="color: #808080;">&#41;</span>
        , @iteration <span style="color: #808080;">=</span> <span style="color: #000;">1</span>;
&nbsp;
    <span style="color: #0000FF;">DECLARE</span> @samples <span style="color: #0000FF;">TABLE</span>
    <span style="color: #808080;">&#40;</span>
          iteration     <span style="color: #0000FF;">INT</span>             Not Null
        , objectName    <span style="color: #0000FF;">NVARCHAR</span><span style="color: #808080;">&#40;</span><span style="color: #000;">128</span><span style="color: #808080;">&#41;</span>   Not Null
        , counterName   <span style="color: #0000FF;">NVARCHAR</span><span style="color: #808080;">&#40;</span><span style="color: #000;">128</span><span style="color: #808080;">&#41;</span>   Not Null
        , instanceName  <span style="color: #0000FF;">NVARCHAR</span><span style="color: #808080;">&#40;</span><span style="color: #000;">128</span><span style="color: #808080;">&#41;</span>   Not Null
        , cntr_value    <span style="color: #0000FF;">FLOAT</span>           Not Null
        , base_value    <span style="color: #0000FF;">FLOAT</span>           Null
        , cntr_type     <span style="color: #0000FF;">BIGINT</span>          Not Null
    <span style="color: #808080;">&#41;</span>;
&nbsp;
    <span style="color: #0000FF;">BEGIN</span> Try
&nbsp;
        <span style="color: #008080;">/* Start a new transaction */</span>
        <span style="color: #0000FF;">BEGIN</span> <span style="color: #0000FF;">TRANSACTION</span>;
&nbsp;
        <span style="color: #008080;">/* Grab all of our counters */</span>
        <span style="color: #0000FF;">INSERT</span> <span style="color: #0000FF;">INTO</span> @samples
        <span style="color: #0000FF;">SELECT</span> @iteration
            , <span style="color: #FF00FF;">RTRIM</span><span style="color: #808080;">&#40;</span>dopc.<span style="color: #FF00FF;">OBJECT_NAME</span><span style="color: #808080;">&#41;</span>
            , <span style="color: #FF00FF;">RTRIM</span><span style="color: #808080;">&#40;</span>dopc.<span style="color: #202020;">counter_name</span><span style="color: #808080;">&#41;</span>
            , <span style="color: #FF00FF;">RTRIM</span><span style="color: #808080;">&#40;</span>dopc.<span style="color: #202020;">instance_name</span><span style="color: #808080;">&#41;</span>
            , <span style="color: #FF00FF;">RTRIM</span><span style="color: #808080;">&#40;</span>dopc.<span style="color: #202020;">cntr_value</span><span style="color: #808080;">&#41;</span>
            , <span style="color: #808080;">&#40;</span><span style="color: #0000FF;">SELECT</span> cntr_value <span style="color: #0000FF;">FROM</span> sys.<span style="color: #202020;">dm_os_performance_counters</span> <span style="color: #0000FF;">AS</span> dopc1
                <span style="color: #0000FF;">WHERE</span> dopc1.<span style="color: #FF00FF;">OBJECT_NAME</span> <span style="color: #808080;">=</span> pcml.<span style="color: #202020;">objectName</span>
                And dopc1.<span style="color: #202020;">counter_name</span> <span style="color: #808080;">=</span> pcml.<span style="color: #202020;">counterName</span> <span style="color: #808080;">+</span> <span style="color: #FF0000;">' base'</span>
                And dopc1.<span style="color: #202020;">instance_name</span> <span style="color: #808080;">=</span> IsNull<span style="color: #808080;">&#40;</span>pcml.<span style="color: #202020;">instanceName</span>, dopc.<span style="color: #202020;">instance_name</span><span style="color: #808080;">&#41;</span><span style="color: #808080;">&#41;</span>
            , dopc.<span style="color: #202020;">cntr_type</span>
        <span style="color: #0000FF;">FROM</span> sys.<span style="color: #202020;">dm_os_performance_counters</span> <span style="color: #0000FF;">AS</span> dopc
        Join dbo.<span style="color: #202020;">dba_perfCounterMonitorConfig</span> <span style="color: #0000FF;">AS</span> pcml
            <span style="color: #0000FF;">ON</span> dopc.<span style="color: #FF00FF;">OBJECT_NAME</span> <span style="color: #808080;">=</span> pcml.<span style="color: #202020;">objectName</span>
                And dopc.<span style="color: #202020;">counter_name</span> <span style="color: #808080;">=</span> pcml.<span style="color: #202020;">counterName</span>
                And dopc.<span style="color: #202020;">instance_name</span> <span style="color: #808080;">=</span> IsNull<span style="color: #808080;">&#40;</span>pcml.<span style="color: #202020;">instanceName</span>, dopc.<span style="color: #202020;">instance_name</span><span style="color: #808080;">&#41;</span>;
&nbsp;
        <span style="color: #008080;">/* During our sample period, grab our counter values and store the results */</span>
        <span style="color: #0000FF;">WHILE</span> <span style="color: #FF00FF;">GETDATE</span><span style="color: #808080;">&#40;</span><span style="color: #808080;">&#41;</span> <span style="color: #808080;">&lt;</span> <span style="color: #FF00FF;">DATEADD</span><span style="color: #808080;">&#40;</span><span style="color: #0000FF;">SECOND</span>, @samplePeriod, @startTime<span style="color: #808080;">&#41;</span>
        <span style="color: #0000FF;">BEGIN</span>
&nbsp;
            <span style="color: #0000FF;">SET</span> @iteration <span style="color: #808080;">=</span> @iteration <span style="color: #808080;">+</span> <span style="color: #000;">1</span>;
&nbsp;
            <span style="color: #0000FF;">INSERT</span> <span style="color: #0000FF;">INTO</span> @samples
            <span style="color: #0000FF;">SELECT</span> @iteration
                , <span style="color: #FF00FF;">RTRIM</span><span style="color: #808080;">&#40;</span>dopc.<span style="color: #FF00FF;">OBJECT_NAME</span><span style="color: #808080;">&#41;</span>
                , <span style="color: #FF00FF;">RTRIM</span><span style="color: #808080;">&#40;</span>dopc.<span style="color: #202020;">counter_name</span><span style="color: #808080;">&#41;</span>
                , <span style="color: #FF00FF;">RTRIM</span><span style="color: #808080;">&#40;</span>dopc.<span style="color: #202020;">instance_name</span><span style="color: #808080;">&#41;</span>
                , dopc.<span style="color: #202020;">cntr_value</span>
                , <span style="color: #808080;">&#40;</span><span style="color: #0000FF;">SELECT</span> cntr_value <span style="color: #0000FF;">FROM</span> sys.<span style="color: #202020;">dm_os_performance_counters</span> <span style="color: #0000FF;">AS</span> dopc1
                    <span style="color: #0000FF;">WHERE</span> dopc1.<span style="color: #FF00FF;">OBJECT_NAME</span> <span style="color: #808080;">=</span> pcml.<span style="color: #202020;">objectName</span>
                    And dopc1.<span style="color: #202020;">counter_name</span> <span style="color: #808080;">=</span> pcml.<span style="color: #202020;">counterName</span> <span style="color: #808080;">+</span> <span style="color: #FF0000;">' base'</span>
                    And dopc1.<span style="color: #202020;">instance_name</span> <span style="color: #808080;">=</span> IsNull<span style="color: #808080;">&#40;</span>pcml.<span style="color: #202020;">instanceName</span>, dopc.<span style="color: #202020;">instance_name</span><span style="color: #808080;">&#41;</span><span style="color: #808080;">&#41;</span>
                , dopc.<span style="color: #202020;">cntr_type</span>
            <span style="color: #0000FF;">FROM</span> sys.<span style="color: #202020;">dm_os_performance_counters</span> <span style="color: #0000FF;">AS</span> dopc
            Join dbo.<span style="color: #202020;">dba_perfCounterMonitorConfig</span> <span style="color: #0000FF;">AS</span> pcml
                <span style="color: #0000FF;">ON</span> dopc.<span style="color: #FF00FF;">OBJECT_NAME</span> <span style="color: #808080;">=</span> pcml.<span style="color: #202020;">objectName</span>
                    And dopc.<span style="color: #202020;">counter_name</span> <span style="color: #808080;">=</span> pcml.<span style="color: #202020;">counterName</span>
                    And dopc.<span style="color: #202020;">instance_name</span> <span style="color: #808080;">=</span> IsNull<span style="color: #808080;">&#40;</span>pcml.<span style="color: #202020;">instanceName</span>, dopc.<span style="color: #202020;">instance_name</span><span style="color: #808080;">&#41;</span>;
&nbsp;
            <span style="color: #008080;">/* Wait for a small delay */</span>
            <span style="color: #0000FF;">WAITFOR</span> Delay @sampleRate;
&nbsp;
        <span style="color: #0000FF;">END</span>;
&nbsp;
        <span style="color: #008080;">/* Grab our end time for calculations */</span>
        <span style="color: #0000FF;">SET</span> @endTime <span style="color: #808080;">=</span> <span style="color: #FF00FF;">GETDATE</span><span style="color: #808080;">&#40;</span><span style="color: #808080;">&#41;</span>;
&nbsp;
        <span style="color: #008080;">/* Store the average of our point-in-time counters */</span>
        <span style="color: #0000FF;">INSERT</span> <span style="color: #0000FF;">INTO</span> dbo.<span style="color: #202020;">dba_perfCounterMonitor</span> 
        <span style="color: #808080;">&#40;</span>
			  captureDate
			, objectName
			, counterName
			, instanceName
			, <span style="color: #0000FF;">VALUE</span>
			, valueType
		<span style="color: #808080;">&#41;</span> 
		<span style="color: #0000FF;">SELECT</span> @startTime
		    , objectName
		    , counterName
		    , instanceName
		    , <span style="color: #FF00FF;">AVG</span><span style="color: #808080;">&#40;</span>cntr_value<span style="color: #808080;">&#41;</span>
		    , <span style="color: #FF0000;">'value'</span>
		<span style="color: #0000FF;">FROM</span> @samples
		<span style="color: #0000FF;">WHERE</span> cntr_type <span style="color: #808080;">=</span> <span style="color: #000;">65792</span>
		<span style="color: #0000FF;">GROUP</span> <span style="color: #0000FF;">BY</span> objectName
		    , counterName
		    , instanceName;
&nbsp;
        <span style="color: #008080;">/* Store the average of the value vs the base for cntr_type = 537003264 */</span>
        <span style="color: #0000FF;">INSERT</span> <span style="color: #0000FF;">INTO</span> dbo.<span style="color: #202020;">dba_perfCounterMonitor</span> 
        <span style="color: #808080;">&#40;</span>
			  captureDate
			, objectName
			, counterName
			, instanceName
			, <span style="color: #0000FF;">VALUE</span>
			, valueType
		<span style="color: #808080;">&#41;</span> 
		<span style="color: #0000FF;">SELECT</span> @startTime
		    , objectName
		    , counterName
		    , instanceName
		    , <span style="color: #FF00FF;">AVG</span><span style="color: #808080;">&#40;</span>cntr_value<span style="color: #808080;">&#41;</span><span style="color: #808080;">/</span><span style="color: #FF00FF;">AVG</span><span style="color: #808080;">&#40;</span>IsNull<span style="color: #808080;">&#40;</span>base_value, <span style="color: #000;">1</span><span style="color: #808080;">&#41;</span><span style="color: #808080;">&#41;</span>
		    , <span style="color: #FF0000;">'percent'</span>
		<span style="color: #0000FF;">FROM</span> @samples
		<span style="color: #0000FF;">WHERE</span> cntr_type <span style="color: #808080;">=</span> <span style="color: #000;">537003264</span>
		<span style="color: #0000FF;">GROUP</span> <span style="color: #0000FF;">BY</span> objectName
		    , counterName
		    , instanceName;
&nbsp;
        <span style="color: #008080;">/* Compare the first and last values for our cumulative, per-second counters */</span>
        <span style="color: #0000FF;">INSERT</span> <span style="color: #0000FF;">INTO</span> dbo.<span style="color: #202020;">dba_perfCounterMonitor</span> 
        <span style="color: #808080;">&#40;</span>
			  captureDate
			, objectName
			, counterName
			, instanceName
			, <span style="color: #0000FF;">VALUE</span>
			, valueType
		<span style="color: #808080;">&#41;</span> 
		<span style="color: #0000FF;">SELECT</span> @startTime
		    , objectName
		    , counterName
		    , instanceName
		    , <span style="color: #808080;">&#40;</span><span style="color: #FF00FF;">MAX</span><span style="color: #808080;">&#40;</span>cntr_value<span style="color: #808080;">&#41;</span> <span style="color: #808080;">-</span> <span style="color: #FF00FF;">MIN</span><span style="color: #808080;">&#40;</span>cntr_value<span style="color: #808080;">&#41;</span><span style="color: #808080;">&#41;</span> <span style="color: #808080;">/</span> <span style="color: #FF00FF;">DATEDIFF</span><span style="color: #808080;">&#40;</span><span style="color: #0000FF;">SECOND</span>, @startTime, @endTime<span style="color: #808080;">&#41;</span>
		    , <span style="color: #FF0000;">'value'</span>
		<span style="color: #0000FF;">FROM</span> @samples
		<span style="color: #0000FF;">WHERE</span> cntr_type <span style="color: #808080;">=</span> <span style="color: #000;">272696576</span>
        <span style="color: #0000FF;">GROUP</span> <span style="color: #0000FF;">BY</span> objectName
		    , counterName
		    , instanceName;
&nbsp;
        <span style="color: #008080;">/* Should we display the results of our most recent execution?  */</span>
        <span style="color: #0000FF;">IF</span> @displayResults <span style="color: #808080;">=</span> <span style="color: #000;">1</span>
            <span style="color: #0000FF;">SELECT</span> captureDate
                , objectName
                , counterName
                , instanceName
                , <span style="color: #0000FF;">VALUE</span>
                , valueType
            <span style="color: #0000FF;">FROM</span> dbo.<span style="color: #202020;">dba_perfCounterMonitor</span> <span style="color: #0000FF;">WITH</span> <span style="color: #808080;">&#40;</span>NoLock<span style="color: #808080;">&#41;</span>
            <span style="color: #0000FF;">WHERE</span> captureDate <span style="color: #808080;">=</span> <span style="color: #0000FF;">CAST</span><span style="color: #808080;">&#40;</span>@startTime <span style="color: #0000FF;">AS</span> <span style="color: #0000FF;">SMALLDATETIME</span><span style="color: #808080;">&#41;</span>
            <span style="color: #0000FF;">ORDER</span> <span style="color: #0000FF;">BY</span> objectName
                , counterName
                , instanceName;
&nbsp;
        <span style="color: #008080;">/* If you have an open transaction, commit it */</span>
        <span style="color: #0000FF;">IF</span> <span style="color: #FF00FF;">@@TRANCOUNT</span> <span style="color: #808080;">&gt;</span> <span style="color: #000;">0</span>
            <span style="color: #0000FF;">COMMIT</span> <span style="color: #0000FF;">TRANSACTION</span>;
&nbsp;
    <span style="color: #0000FF;">END</span> Try
    <span style="color: #0000FF;">BEGIN</span> Catch
&nbsp;
        <span style="color: #008080;">/* Whoops, there was an error... rollback! */</span>
        <span style="color: #0000FF;">IF</span> <span style="color: #FF00FF;">@@TRANCOUNT</span> <span style="color: #808080;">&gt;</span> <span style="color: #000;">0</span>
            <span style="color: #0000FF;">ROLLBACK</span> <span style="color: #0000FF;">TRANSACTION</span>;
&nbsp;
        <span style="color: #008080;">/* Return an error message and log it */</span>
        <span style="color: #0000FF;">EXECUTE</span> dbo.<span style="color: #202020;">dba_logError_sp</span>;
&nbsp;
    <span style="color: #0000FF;">END</span> Catch;
&nbsp;
    <span style="color: #0000FF;">SET</span> <span style="color: #0000FF;">NOCOUNT</span> <span style="color: #0000FF;">OFF</span>;
    <span style="color: #0000FF;">RETURN</span> <span style="color: #000;">0</span>;
<span style="color: #0000FF;">END</span>
Go</pre></div></div>

<p>Like I said, it&#8217;s not perfect, but it gets the job done.  <img src='http://sqlfool.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Getting an error about dba_logError_sp?  Take a look at my <a href="http://sqlfool.com/2008/12/error-handling-in-t-sql/" target="_blank">error handling proc</a>.</p>
<img src="http://feeds.feedburner.com/~r/SqlFool/~4/mNmzwj4VXcg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sqlfool.com/2009/09/monitoring-process-for-performance-counters/feed/</wfw:commentRss>
		<feedburner:origLink>http://sqlfool.com/2009/09/monitoring-process-for-performance-counters/</feedburner:origLink></item>
		<item>
		<title>Undocumented Function in SQL 2008</title>
		<link>http://feedproxy.google.com/~r/SqlFool/~3/Lt85D-qMDQQ/</link>
		<comments>http://sqlfool.com/2009/09/undocumented-function-in-sql-2008/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 01:39:52 +0000</pubDate>
		<dc:creator>Michelle Ufford</dc:creator>
		
		<category><![CDATA[Internals]]></category>

		<category><![CDATA[SQL 2008]]></category>

		<category><![CDATA[Syndication]]></category>

		<category><![CDATA[2008]]></category>

		<category><![CDATA[pages]]></category>

		<category><![CDATA[undocumented commands]]></category>

		<guid isPermaLink="false">http://sqlfool.com/?p=1154</guid>
		<description><![CDATA[If you&#8217;ve been following my blog for a little while, you&#8217;ll know that I&#8217;m a fan of SQL Server internals.  There&#8217;s a lot that can be learned or better understood by rolling up your sleeves and getting into the nitty-gritty of data pages (i.e. see my post on Overhead in Non-Unique Clustered Indexes).  [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve been following my blog for a little while, you&#8217;ll know that I&#8217;m a fan of SQL Server internals.  There&#8217;s a lot that can be learned or better understood by rolling up your sleeves and getting into the nitty-gritty of data pages (i.e. see my post on <a href="http://sqlfool.com/2009/05/overhead-i-non-unique-clustered-indexes/" target="_blank">Overhead in Non-Unique Clustered Indexes</a>).  So imagine how happy I was when my co-worker Jeff shared an undocumented function with me today that retrieves the file number, page number, and slot number of a single record.  Very cool!  Well, at least to me.  So now let&#8217;s see how you can use it.</p>
<p>The fn_physLocCracker function can be called in the following way:</p>

<div class="wp_syntax"><div class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #0000FF;">SELECT</span> <span style="color: #0000FF;">TOP</span> <span style="color: #000;">100</span> plc.<span style="color: #808080;">*</span>, soh.<span style="color: #202020;">SalesOrderID</span>
<span style="color: #0000FF;">FROM</span> Sales.<span style="color: #202020;">SalesOrderHeader</span> <span style="color: #0000FF;">AS</span> soh
Cross Apply sys.<span style="color: #202020;">fn_physLocCracker</span> <span style="color: #808080;">&#40;</span><span style="color: #808080;">%%</span>physloc<span style="color: #808080;">%%</span><span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">AS</span> plc;</pre></div></div>

<p>Results (just a sample):</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">file_id     page_id     slot_id     SalesOrderID
----------- ----------- ----------- ------------
1           14032       0           43659
1           14032       1           43660
1           14032       2           43661
1           14032       3           43662
1           14032       4           43663</pre></div></div>

<p>If you look at the <a href="http://msdn.microsoft.com/en-us/library/ms176112.aspx" target="_blank">sp_helptext</a> for sys.fn_physLocCracker, %%physloc%% is apparently a virtual column that contains information on where the record is stored.  In fact, you can even append %%physloc%% to your column list if you want to see how the information is stored.  But for our purposes, we now have a file number, page number, and slot number.  What do we do with it?</p>
<p>Well, you can use the <a href="http://sqlfool.com/2009/05/page-internals-investigation-proc/" target="_blank">investigation proc I wrote</a> to retrieve the actual data page:</p>

<div class="wp_syntax"><div class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #0000FF;">EXECUTE</span> dba_viewPageData_sp 
      @databaseName <span style="color: #808080;">=</span> <span style="color: #FF0000;">'AdventureWorks'</span>
    , @fileNumber <span style="color: #808080;">=</span> <span style="color: #000;">1</span>
    , @pageNumber <span style="color: #808080;">=</span> <span style="color: #000;">14032</span>;</pre></div></div>

<p>Results (just a sample):</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Slot 0 Column 1 Offset 0x4 Length 4 Length (physical) 4
&nbsp;
SalesOrderID = 43659                 
&nbsp;
Slot 0 Column 2 Offset 0x8 Length 1 Length (physical) 1
&nbsp;
RevisionNumber = 1                   
&nbsp;
Slot 0 Column 3 Offset 0x9 Length 8 Length (physical) 8
&nbsp;
OrderDate = 2001-07-01 00:00:00.000  
&nbsp;
Slot 0 Column 4 Offset 0x11 Length 8 Length (physical) 8
&nbsp;
DueDate = 2001-07-13 00:00:00.000</pre></div></div>

<p>Neat, huh?  So why would you use it to look up the data page and file number when you can just pass the table name and index name to my proc and retrieve data pages?  Well, my investigation proc will retrieve data pages for any index type &#8212; the fn_physLocCracker function will only retrieve data for the clustered index &#8212; but it will not retrieve the data page for a specific record.  So just something to be aware of.</p>
<p>That&#8217;s all for now.  Back to the #24HoursOfPASS!  <img src='http://sqlfool.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/SqlFool/~4/Lt85D-qMDQQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sqlfool.com/2009/09/undocumented-function-in-sql-2008/feed/</wfw:commentRss>
		<feedburner:origLink>http://sqlfool.com/2009/09/undocumented-function-in-sql-2008/</feedburner:origLink></item>
		<item>
		<title>Getting Started with Variables in SSIS</title>
		<link>http://feedproxy.google.com/~r/SqlFool/~3/vbSYDaaPgv8/</link>
		<comments>http://sqlfool.com/2009/08/getting-started-with-variables-in-ssis/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 13:13:51 +0000</pubDate>
		<dc:creator>Michelle Ufford</dc:creator>
		
		<category><![CDATA[Business Intelligence]]></category>

		<category><![CDATA[Syndication]]></category>

		<category><![CDATA[bi]]></category>

		<category><![CDATA[BIDS]]></category>

		<category><![CDATA[SSIS]]></category>

		<guid isPermaLink="false">http://sqlfool.com/?p=1134</guid>
		<description><![CDATA[I recently had to create an SSIS package that used variables to pass data between procs, and I thought it would make a good topic for a blog post.  There are many scenarios as to the how and why to use variables in SSIS, but we&#8217;re going to keep it pretty simple.  Let&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had to create an SSIS package that used variables to pass data between procs, and I thought it would make a good topic for a blog post.  There are many scenarios as to the how and why to use variables in SSIS, but we&#8217;re going to keep it pretty simple.  Let&#8217;s assume we have some need to retrieve data from Proc A, pass it to Proc B, and store the results in Table C.  First, let&#8217;s set up our environment:</p>

<div class="wp_syntax"><div class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #0000FF;">USE</span> AdventureWorks;
Go
&nbsp;
<span style="color: #0000FF;">CREATE</span> <span style="color: #0000FF;">PROCEDURE</span> dbo.<span style="color: #202020;">LastOrderGet_sp</span>
<span style="color: #0000FF;">AS</span>
<span style="color: #0000FF;">SET</span> <span style="color: #0000FF;">NOCOUNT</span> <span style="color: #0000FF;">ON</span>;
<span style="color: #0000FF;">BEGIN</span>
&nbsp;
    <span style="color: #0000FF;">SELECT</span> <span style="color: #FF00FF;">MAX</span><span style="color: #808080;">&#40;</span>SalesOrderID<span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">AS</span> <span style="color: #FF0000;">'LastSalesOrderID'</span>
    <span style="color: #0000FF;">FROM</span> AdventureWorks.<span style="color: #202020;">Sales</span>.<span style="color: #202020;">SalesOrderHeader</span> <span style="color: #0000FF;">WITH</span> <span style="color: #808080;">&#40;</span>NoLock<span style="color: #808080;">&#41;</span>
&nbsp;
    <span style="color: #0000FF;">SET</span> <span style="color: #0000FF;">NOCOUNT</span> <span style="color: #0000FF;">OFF</span>;
    <span style="color: #0000FF;">RETURN</span> <span style="color: #000;">0</span>;
<span style="color: #0000FF;">END</span>
Go
&nbsp;
<span style="color: #0000FF;">CREATE</span> <span style="color: #0000FF;">PROCEDURE</span> dbo.<span style="color: #202020;">ProcessLastOrder_sp</span>
    @LastOrderID <span style="color: #0000FF;">INT</span>
<span style="color: #0000FF;">AS</span>
<span style="color: #0000FF;">SET</span> <span style="color: #0000FF;">NOCOUNT</span> <span style="color: #0000FF;">ON</span>;
<span style="color: #0000FF;">BEGIN</span>
&nbsp;
    <span style="color: #0000FF;">SELECT</span> SalesOrderDetailID
        , ProductID
        , OrderQty
        , LineTotal
    <span style="color: #0000FF;">FROM</span> AdventureWorks.<span style="color: #202020;">Sales</span>.<span style="color: #202020;">SalesOrderDetail</span> <span style="color: #0000FF;">WITH</span> <span style="color: #808080;">&#40;</span>NoLock<span style="color: #808080;">&#41;</span>
    <span style="color: #0000FF;">WHERE</span> SalesOrderID <span style="color: #808080;">=</span> @LastOrderID;
&nbsp;
    <span style="color: #0000FF;">SET</span> <span style="color: #0000FF;">NOCOUNT</span> <span style="color: #0000FF;">OFF</span>;
    <span style="color: #0000FF;">RETURN</span> <span style="color: #000;">0</span>;
<span style="color: #0000FF;">END</span>
Go
&nbsp;
<span style="color: #0000FF;">CREATE</span> <span style="color: #0000FF;">TABLE</span> dbo.<span style="color: #202020;">testStage</span>
<span style="color: #808080;">&#40;</span>
      SalesOrderDetailID    <span style="color: #0000FF;">INT</span>
    , ProductId             <span style="color: #0000FF;">INT</span>
    , OrderQty              <span style="color: #0000FF;">SMALLINT</span>
    , LineTotal             <span style="color: #0000FF;">NUMERIC</span>
<span style="color: #808080;">&#41;</span>;
Go</pre></div></div>

<p>Now for the fun stuff!  </p>
<p><em>(Please note, I&#8217;m assuming some basic understanding of SSIS, so I&#8217;m skipping the &#8220;how to create a project&#8221;, etc. stuff and just going to the pertinent parts).</em></p>
<p>Inside BIDS (Business Intelligence Development Studio), create a new SSIS project and call it what you will.  If your Variable window is not already open, open it now by going to <strong>View</strong> &#8211;> <strong>Other Windows</strong> &#8211;> <strong>Variables</strong>.</p>
<div class="wp-caption alignnone" style="width: 632px"><a href="http://sqlfool.com/blogImages/20090824/SSIS_variable_01.jpg"><img alt="Open Variables Window" src="http://sqlfool.com/blogImages/20090824/SSIS_variable_01.jpg" title="Open Variables Window" width="80%" height="80%" /></a><p class="wp-caption-text">Open Variables Window</p></div>
<p>Now let&#8217;s create a variable.  To do this, click on the little icon in the upper left-hand corner of the Variables window.  Name the variable <strong>LastSalesOrderID</strong>.</p>
<div class="wp-caption alignnone" style="width: 414px"><a href="http://sqlfool.com/blogImages/20090824/SSIS_variable_02.jpg"><img alt="Create a variable" src="http://sqlfool.com/blogImages/20090824/SSIS_variable_02.jpg" title="Create a variable" width="404" height="203" /></a><p class="wp-caption-text">Create a variable</p></div>
<p>After you create the variable, you should now see it in the Variables window.  Make sure the scope of the variable is the name of your project, which is &#8220;Blog&#8221; in my case (for obvious reasons); this means the variable is defined at the package scope.  Once you&#8217;ve confirmed that the variable exists, create an Execute SQL task.</p>
<p><em>(Variables in SSIS, like in other programming languages, can have different scopes.  For instance, a package scope means the variable can be accessed anywhere within the package, but a variable with a Data Flow scope can only be accessed within the specified Data Flow task.)</em></p>
<div class="wp-caption alignnone" style="width: 646px"><a href="http://sqlfool.com/blogImages/20090824/SSIS_variable_03.jpg"><img alt="Create Execute SQL Task" src="http://sqlfool.com/blogImages/20090824/SSIS_variable_03.jpg" title="Create Execute SQL Task" width="80%" height="80%" /></a><p class="wp-caption-text">Create Execute SQL Task</p></div>
<p>Double-click on your Execute SQL Task and configure with the following values:</p>
<ul>
<li>Set &#8220;Result Set&#8221; to <strong>Single Row</strong>.</li>
<li>Set your Connection to your appropriate data source.</li>
<li>Set your SQL Statement to: <strong>Execute AdventureWorks.dbo.LastOrderGet_sp;</strong></li>
</ul>
<div class="wp-caption alignnone" style="width: 635px"><a href="http://sqlfool.com/blogImages/20090824/SSIS_variable_04.jpg"><img alt="Set up your Execute SQL Task" src="http://sqlfool.com/blogImages/20090824/SSIS_variable_04.jpg" title="Set up your Execute SQL Task" width="80%" height="80%" /></a><p class="wp-caption-text">Set up your Execute SQL Task</p></div>
<p>Now click on &#8220;Result Set&#8221; and click on &#8220;Add.&#8221;  You&#8217;ll want to put the name of the column that&#8217;s returned by the proc in the &#8220;Result Name&#8221; column; in our case, that&#8217;ll be <strong>LastSalesOrderID</strong>.  Click on the Variable Name column and scroll down until you find the appropriate one (<strong>User::LastSalesOrderID</strong>).</p>
<div class="wp-caption alignnone" style="width: 592px"><a href="http://sqlfool.com/blogImages/20090824/SSIS_variable_05.jpg"><img alt="Mapping the results to a variable" src="http://sqlfool.com/blogImages/20090824/SSIS_variable_05.jpg" title="Mapping the results to a variable" width="582" height="563" /></a><p class="wp-caption-text">Mapping the results to a variable</p></div>
<p>Go ahead and add a Data Flow task to the designer surface.  We don&#8217;t need to use a Data Flow task here &#8212; for example, we could use another Execute SQL task instead &#8212; but this will help demonstrate one way to use variables.  </p>
<div class="wp-caption alignnone" style="width: 646px"><a href="http://sqlfool.com/blogImages/20090824/SSIS_variable_06.jpg"><img alt="Add Data Flow Task" src="http://sqlfool.com/blogImages/20090824/SSIS_variable_06.jpg" title="Add Data Flow Task" width="80%" height="80%" /></a><p class="wp-caption-text">Add Data Flow Task</p></div>
<p>Double-click on the Data Flow task and add an OLE DB Source, then double-click on it to open up the properties.  Enter the following text in the &#8220;SQL Command text&#8221; window:<br />
<strong>Execute AdventureWorks.dbo.ProcessLastOrder_sp ?</strong><br />
The question mark (?) tells SSIS to expect a parameter.  </p>
<div class="wp-caption alignnone" style="width: 660px"><a href="http://sqlfool.com/blogImages/20090824/SSIS_variable_07.jpg"><img alt="Edit OLE DB Source" src="http://sqlfool.com/blogImages/20090824/SSIS_variable_07.jpg" title="Edit OLE DB Source" width="80%" height="80%" /></a><p class="wp-caption-text">Edit OLE DB Source</p></div>
<p>Now click on the Parameters button on the left.  This is where we map our variable to our parameter.  For the &#8220;Parameters&#8221; value, enter <strong>@LastOrderID</strong> (the parameter the stored procedure is expecting).  In the &#8220;Variables&#8221; column, click on the drop-down and navigate to the <strong>User::LastSalesOrderID</strong> variable. </p>
<div class="wp-caption alignnone" style="width: 406px"><a href="http://sqlfool.com/blogImages/20090824/SSIS_variable_08.jpg"><img alt="Map Variables to Parameters" src="http://sqlfool.com/blogImages/20090824/SSIS_variable_08.jpg" title="Map Variables to Parameters" width="396" height="411" /></a><p class="wp-caption-text">Map Variables to Parameters</p></div>
<p>Finally, set up an OLE DB Destination, and configure the OLE DB Source to load into the testStage table.  </p>
<div class="wp-caption alignnone" style="width: 660px"><a href="http://sqlfool.com/blogImages/20090824/SSIS_variable_09.jpg"><img alt="Configure OLE DB Destination" src="http://sqlfool.com/blogImages/20090824/SSIS_variable_09.jpg" title="Configure OLE DB Destination" width="80%" height="80%" /></a><p class="wp-caption-text">Configure OLE DB Destination</p></div>
<p>At this point, you should be able to successfully execute your package.  Upon successful execution, the testStage table will return the following results:</p>

<div class="wp_syntax"><div class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #0000FF;">SELECT</span> <span style="color: #808080;">*</span> <span style="color: #0000FF;">FROM</span> testStage;
&nbsp;
SalesOrderDetailID ProductId   OrderQty LineTotal
<span style="color: #008080;">------------------ ----------- -------- ------------------</span>
<span style="color: #000;">121315</span>             <span style="color: #000;">878</span>         <span style="color: #000;">1</span>        <span style="color: #000;">21</span>
<span style="color: #000;">121316</span>             <span style="color: #000;">879</span>         <span style="color: #000;">1</span>        <span style="color: #000;">159</span>
<span style="color: #000;">121317</span>             <span style="color: #000;">712</span>         <span style="color: #000;">1</span>        <span style="color: #000;">8</span></pre></div></div>

<p>That&#8217;s all for now.  Hopefully this gives you an idea of how easy and useful it is to work with variables in SSIS.</p>
<img src="http://feeds.feedburner.com/~r/SqlFool/~4/vbSYDaaPgv8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://sqlfool.com/2009/08/getting-started-with-variables-in-ssis/feed/</wfw:commentRss>
		<feedburner:origLink>http://sqlfool.com/2009/08/getting-started-with-variables-in-ssis/</feedburner:origLink></item>
	</channel>
</rss>
