Timeline for sp_add_jobstep add more than 4000 Character in @command parameter
Current License: CC BY-SA 3.0
3 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 1, 2017 at 23:20 | comment | added | Robert Carnegie | I may have been making this mistake of mixing types in a string for EXEC() or for sp_executesql . I hadn't identified some combinations as safe and some not, but my workaround for it has been to use just one long string which contains token marker terms like @{explicit_integer} and '@{explicit_string}', into @template nvarchar(max), then, REPLACE() each of the tokens with the required value, instead of inserting by adding strings together. | |
May 31, 2017 at 23:37 | comment | added | SqlWorldWide |
Thank you. I agree with your comment about implicit conversion. My problem was part of my string was NVARCHAR and part was VARCHAR . I started with N then I had many variables in the string where I did not put N' . Once I added N in front of every string it did work for me. After @tblUpdateStats_List I have many more strings separated by variables.
|
|
May 31, 2017 at 23:18 | history | answered | RDFozz | CC BY-SA 3.0 |