|
I'm trying to run this code: */ **I get this output** Here, literals @cstring and @rstring do not have their values at output. Please help. Thanks.
(comments are locked)
|
|
As @Oleg has already pointed out, it is working as it should be. sp_ExecuteSQL would assign the values to the params at runtime while execution. But it would not change the content of your dynamic SQL variable @SQL. So if you are printing your dynamic SQL after/before execution, it will still print it the same. If you want to see the values printed as well then you need to tweak your dynamic sql something like
(comments are locked)
|


So far everything looks good. Where do you have a problem? If you were to print your dynamic sql variable, it would print the update statement which includes 2 parameters which are fed to the statement when you run your execute, so it should work as is.