April 17, 2014 at 8:26 am
Hehehe, i just forgot to save the @Percentage value for each row, or at least when the first insert statement doesnt run... But nice to pointing that out.
Thanks for the solution, that was the kind of solution that i was looking for. I don't know why but I just put in my head that what i'm trying to do was very complicated...
Thanks
Solved
April 17, 2014 at 8:40 am
rootfixxxer (4/17/2014)
Hehehe, i just forgot to save the @Percentage value for each row, or at least when the first insert statement doesnt run... But nice to pointing that out.Thanks for the solution, that was the kind of solution that i was looking for. I don't know why but I just put in my head that what i'm trying to do was very complicated...
Thanks
Solved
Glad we were able to figure out a solution. The challenge is in changing the way you think about data. Instead of thinking about what you need to do to a row, you need to think about what you want to do to a column. Thinking in sets is a different way to view data. It takes practice and a desire to do it. You have the desire which is the hard part.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
April 17, 2014 at 8:53 am
Nice tip, I'll have that in mind in the future.
Normally my approach it's building a working solution, like the cursor version heavy/slow, and then working my way out to optimizing it... Sometimes i get cool solutions...
Viewing 3 posts - 16 through 17 (of 17 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy