Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    Location
    The Netherlands
    Posts
    9

    Unanswered: Stored Procedure with 'N' and variable

    Hi,

    I need to compare words with eachother, but the words can also be a sign (japanese, chinese, etc)
    I use NVarChar. Below is the code i use to compare them (Stored Procedure):
    --------------
    CREATE PROCEDURE sp_selectLanguage
    @Language_Name nvarchar(255)
    AS
    SELECT Language_ID FROM Languages WHERE Language_Name = @Language_Name
    GO

    -----------end----

    eg. @Language_Name is English, it works, but not with a sign. Therefor u need this:
    ... WHERE Language_Name = N'here comes the variable'

    But how can I code this?
    Not by this: WHERE Language_Name = N @Language_Name

    Please help

  2. #2
    Join Date
    Jul 2002
    Location
    Village, MD
    Posts
    621
    Try to call sp:

    sp_selectLanguage N'here comes the variable'

    or

    declare @Language_Name nvarchar(255)
    set @Language_Name=N'here comes the variable'
    exec sp_selectLanguage @Language_Name

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •