Viewing 15 posts - 2,191 through 2,205 (of 2,917 total)
This may not be the most elegant solution, but I believe it should work for you. Just need to un-comment the EXEC(@SQLCMD) line:
DECLARE @SQLCMD VARCHAR(MAX) = '';
DECLARE...
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
Quick fix:
In the line "SET @SQLQuery", try casting your @intID to an NVARCHAR(255).
EDIT - re-read your post and I see you tried this already. Is it giving the same error...
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
Viewing 15 posts - 2,191 through 2,205 (of 2,917 total)