Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003

    Unanswered: Multi-lang, Dynamic Table and SP problem

    Hello all,

    I got a problem with Multi language when it comes to Dynamic Tables in Store procedures.

    If I do the following :

    PHP Code:
    SET @StringTableName N'System_Strings'
    SET @StringID N'100'
    SET @LanguageID N'2'
    SET @StringText N'أثممخ ًخقمي'
    SET @Mandatory N'0'

    EXEC (N'INSERT ' + @StringTableName N' (StringID, LanguageID, StringText, Mandatory) VALUES(''' + @StringID ''', ''' + @LanguageID ''', ''' + @StringText ''', ''' + @Mandatory +''')'
    The StringText column shows up as ????????? in the Db.

    However if I do the following:

    PHP Code:
    INSERT System_Strings (StringIDLanguageIDStringTextMandatoryVALUES(@StringID, @LanguageID, @StringText, @Mandatory
    The StringText column shows with the correct Arabic text.

    Does anybody know how to use Dynamic Tables aswell as Multi Language?

    Best Wishes,

  2. #2
    Join Date
    Feb 2004
    In front of the computer
    Provided Answers: 54
    The same rules apply... If you want dynamic code to be considered as Unicode, you need to prefix the string with an N. You want something like:
    SET @StringTableName = N'System_Strings' 
    SET @StringID = N'100' 
    SET @LanguageID = N'2' 
    SET @StringText = N'أثممخ ًخقمي' 
    SET @Mandatory = N'0' 
    EXEC (N'INSERT ' + @StringTableName 
    + N' (StringID, LanguageID, StringText, Mandatory) VALUES(N''' 
    + @StringID + ''', N''' + @LanguageID + ''', N''' + @StringText + ''', N''' 
    + @Mandatory +''')')

Posting Permissions

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