Query Help -

  • Lynn Pettis - Tuesday, December 5, 2017 9:17 AM

    That would have to be one hell of a long piece of dynamic SQL.  I do agree, however, especially if you actually need to include UNICODE characters in the dynamic SQL.  Of course there is someone (not me) out there that would disagree with you.

    You don't need to include them, but the type is required to use it on sp_executesql.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Luis Cazares - Tuesday, December 5, 2017 9:34 AM

    Lynn Pettis - Tuesday, December 5, 2017 9:17 AM

    That would have to be one hell of a long piece of dynamic SQL.  I do agree, however, especially if you actually need to include UNICODE characters in the dynamic SQL.  Of course there is someone (not me) out there that would disagree with you.

    You don't need to include them, but the type is required to use it on sp_executesql.

    I always declare my variables as nvarchar(max) for the sql command and sql parameters variables.  I also try to use the N' but sometimes forget that part.

  • Lynn Pettis - Tuesday, December 5, 2017 9:43 AM

    Luis Cazares - Tuesday, December 5, 2017 9:34 AM

    Lynn Pettis - Tuesday, December 5, 2017 9:17 AM

    That would have to be one hell of a long piece of dynamic SQL.  I do agree, however, especially if you actually need to include UNICODE characters in the dynamic SQL.  Of course there is someone (not me) out there that would disagree with you.

    You don't need to include them, but the type is required to use it on sp_executesql.

    I always declare my variables as nvarchar(max) for the sql command and sql parameters variables.  I also try to use the N' but sometimes forget that part.

    I forget it as well, that's why I have it on my code review checklist. 😉

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 3 posts - 31 through 33 (of 33 total)

You must be logged in to reply to this topic. Login to reply