Just a General Request.
When giving a helpful reply, throw in a few comments to explain some of the less obvious SQL statements. It can make a world of difference to have even a few words explaining some of the logic & syntax, and only takes a few seconds to type it.
It can save the reader, especially a newbie, lots of head scratching.
I suspect Jeff (and probably others) may disagree with me here but there's another school of thought.
While good comments explaining what is going on is great in Prod code, helpful answers to a forum question are those that help the OP learn.
That may mean a little bit of head scratching. Seriously, are you willing to dump some code into Prod just because you found it on the Internet? Better to dissect it and thoroughly understand it first. Comments may possibly distract you from doing that, by beguiling you into thinking that you know what is going on when in reality you may not.
I'm always available to answer questions if you don't understand some code I've posted.
Nope. I don't disagree at all. That's why I document the hell out of most of the code I post and do the "Alices Restaurant" thing with what I write up.
There are times, however (like the post I just answered about telephone number formats) where I believe the answer is simple enough that if the OP doesn't know what LIKE is, they should take it upon themselves to look up what LIKE does. Ostensibly, the OPs are "programmers" and they should know to lookup things they see in code that they don't know about.
As with all else, "It Depends".
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