A very similar script is in BOL if you look up CHAR.
Agreed... and it shouldn't be used either. ;-)
For those that haven't seen it, please see the following for how a "Numbers" or "Tally" can be used as a very high performance replacement for certain types of While Loops...http://www.sqlservercentral.com/articles/T-SQL/62867/
There are dozens of uses for such a table.
I also agree with Jon... if you find something that may be useful, it's impossible to know if it posted somewhere else or even in BOL. Nothing wrong with posting something you may think is useful even if it's documented in BOL. After all, there are still a lot of folks that don't even know what BOL is never mind having actually read it from top to bottom.
is pronounced ree-bar and is a Modenism for R
First step towards the paradigm shift of writing Set Based code: Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is usually not.
Just because you can do something in PowerShell, doesnt mean you should. Helpful Links:
How to post code problemsHow to post performance problemsForum FAQs