We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

Devi • 11 years ago

its very helpful. Thank u:)

denisvaleev • 12 years ago

I have a lot of those in my snippet manager by Red Gate. Say, I type dvCSV... and up comes this exact snippet of code right in the SSMS. Are you sure you don't need to cast xml as varchar(max) before stuffing empty string instead of the first character? Just saying.

davidduffett • 12 years ago

No need to cast as far as I know - thanks for the comment!

denisvaleev • 12 years ago

Well then, it's even simpler than I thought! Keep up the good work, Mr. Beer Man. :)

davidduffett • 10 years ago

Regarding your CAST comment - you're absolutely right. If the overall string length gets too large you run into it being truncated. I'll update the post to reflect this, and thanks for jogging my memory (came across this problem a while ago!)

Hector Pacheco • 7 years ago

very help full tip, thanks!

Ray • 8 years ago

How to add this to a report in SCCM reporting? So the report returns multiple lines for each PC (one for each NIC). I get a lot of syntax error, while trying to implement the fields from SQL views in your code.

Reshma • 9 years ago

I want the same thing but with some changes like Model 1, Model 2 , Model 3, Model 4, Model 5 , Model 6 , Model 7, Model 8, Model 9 , Model 10 + 5 more when there are 15 models . Can any one help ?

Parvez Khan • 9 years ago

Thank you very much.Its helps me.God bless you.

Newbie • 10 years ago

What if my ModelThisFits from 3rd table?

davidduffett • 10 years ago

Do you have an example? Not sure what you mean.

Guest • 10 years ago

What if my ModelThisFits from either M.ProductId or P.ProductId?

KaanWhite • 11 years ago

Perfect !

Abc • 11 years ago

Thanks for explaining it in a simple way....

Dawid Kowalski • 12 years ago

Very useful, thanks :-D

Nick • 12 years ago

Thanks for example, very helpful !