Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Article Discussions
»
Article Discussions by Author
»
Discuss content posted by Dave Ballantyne
»
Optimizing a cursor based routine – Part 2
16 posts, Page 1 of 2
1
2
»»
Optimizing a cursor based routine – Part 2
Rate Topic
Display Mode
Topic Options
Author
Message
Dave Ballantyne
Dave Ballantyne
Posted Monday, June 27, 2011 9:20 PM
SSCommitted
Group: General Forum Members
Last Login: Tuesday, May 28, 2013 3:05 AM
Points: 1,943,
Visits: 8,229
Comments posted to this topic are about the item
Optimizing a cursor based routine – Part 2
Clear Sky SQL
My Blog
Kent user group
Post #1132599
SQLRNNR
SQLRNNR
Posted Tuesday, June 28, 2011 9:55 AM
SSCoach
Group: General Forum Members
Last Login: Today @ 12:32 AM
Points: 18,855,
Visits: 12,439
Just to nitpick something. The adventureworks sales were understated by ~ $22M, not $28M.
Nice article Dave.
Jason
AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server 2008
SQL RNNR
Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1133016
ShawnTherrien
ShawnTherrien
Posted Tuesday, June 28, 2011 11:03 AM
Valued Member
Group: General Forum Members
Last Login: Tuesday, June 11, 2013 9:34 AM
Points: 68,
Visits: 656
Thank you.
I understand the topic of optimizing a cursor based routine pretty well and yet again another day comes where I learn how much more I have to learn. I can't wait to try out some of these techniques on some more complex reports!
Post #1133090
KWymore
KWymore
Posted Tuesday, June 28, 2011 11:56 AM
SSCrazy
Group: General Forum Members
Last Login: 2 days ago @ 6:13 AM
Points: 2,598,
Visits: 1,551
Very nice article. We have very few cursors but I have learned other performance improving tips from this article regardless.
Post #1133135
WayneS
WayneS
Posted Tuesday, June 28, 2011 4:18 PM
SSCertifiable
Group: General Forum Members
Last Login: Yesterday @ 9:59 PM
Points: 6,386,
Visits: 8,288
Good job Dave - very well written.
Wayne
Microsoft Certified Master: SQL Server 2008
If you can't explain to another person how the code that you're copying from the internet works, then
DON'T USE IT
on a production system! After all,
you
will be the one supporting it!
Links:
For better assistance in answering your questions
,
How to ask a question
,
Performance Problems
,
Common date/time routines
,
CROSS-TABS and PIVOT tables Part 1
&
Part 2
,
Using APPLY Part 1
&
Part 2
,
Splitting Delimited Strings
Post #1133318
spaghettidba
spaghettidba
Posted Tuesday, June 28, 2011 5:02 PM
SSCarpal Tunnel
Group: General Forum Members
Last Login: Yesterday @ 3:43 AM
Points: 4,804,
Visits: 8,091
Top-notch contributions from you Dave, as usual!
Keep up the great job.
Get your two-cent-answer quickly
The Spaghetti DBA
Post #1133335
Dave Ballantyne
Dave Ballantyne
Posted Wednesday, June 29, 2011 2:54 AM
SSCommitted
Group: General Forum Members
Last Login: Tuesday, May 28, 2013 3:05 AM
Points: 1,943,
Visits: 8,229
Thanks all,
Enjoyed doing it, now to find the next set of bad code to write about :)
Clear Sky SQL
My Blog
Kent user group
Post #1133501
CELKO
CELKO
Posted Wednesday, June 29, 2011 1:03 PM
SSCommitted
Group: General Forum Members
Last Login: Tuesday, January 15, 2013 11:11 AM
Points: 1,945,
Visits: 2,782
Dave Ballantyne (6/29/2011)
Thanks all,
Enjoyed doing it, now to find the next set of bad code to write about :)
Actually, you can go back to the DDL in this nightmare. Singular names for tables, vague names for columns, etc. Tables for the same data model split into different locations. My favor was "FROM Store.Store" -- I was waiting for a column "Store.Store.store" to complete the pain for the bastard that has to maintian this.
The idiot that did this thinks that a customer is an attribute of a store, and not in a relationship with the store. Etc. There is so little in this schema.
Basically this is an EAV and OO design mashed into SQL. You even have functions to mimic methods! Is it too much to ask that MS actually follow basic ISO standards and data modeling? Rant, rant.
Books in Celko Series for Morgan-Kaufmann Publishing
Analytics and OLAP in SQL
Data and Databases: Concepts in Practice
Data, Measurements and Standards in SQL
SQL for Smarties
SQL Programming Style
SQL Puzzles and Answers
Thinking in Sets
Trees and Hierarchies in SQL
Post #1134007
Dave Ballantyne
Dave Ballantyne
Posted Wednesday, June 29, 2011 1:17 PM
SSCommitted
Group: General Forum Members
Last Login: Tuesday, May 28, 2013 3:05 AM
Points: 1,943,
Visits: 8,229
Something tells me you are not a fan of AdventureWorks Joe ;)
Clear Sky SQL
My Blog
Kent user group
Post #1134030
jerome.landis
jerome.landis
Posted Thursday, June 30, 2011 3:51 PM
Grasshopper
Group: General Forum Members
Last Login: Thursday, April 25, 2013 5:32 AM
Points: 13,
Visits: 54
Dave, excellent job with the post! Very informative and good example to demo the technology.
Big Question: Where can I find the AdventureWorks2008R2 database?
I was running it against the AdventureWorks database but some of the columns/tables are missing....
I have downloaded almost everything off codeplex, and I have found these databases:
1) adventureworks
2) adventureworksDW
3) adventureworksDW2008
4) adventureworksDW2008R2
5) adventureworksLT
6) adventureworksLT2008R2
But no database named "AdventureWorks2008R2"?
Post #1134752
« Prev Topic
|
Next Topic »
16 posts, Page 1 of 2
1
2
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.