>>>Why do you need those single quotes on 'StockDetail' and on
'<<cIvdCode>>'
?
>>
>
>uups. Did not think of that...
>
>It just looked a bit strange to me. I would normally put just table name without quotes.
>Moreover, I was expecting some error when putting quotes around table name, but this works anyway.
>
>Mu bad :)
>
>I would however prefer prefer direct string construction as apposed to textmerge when it comes to constructing script code.
I prefer textmerge as it allows to write long scripts very clear and with CRLF. You can not do this with string concatenation and copy/paste the query in SSMS will be much harder.
If it's not broken, fix it until it is.
My Blog