Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6197937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:54:32+00:00 2026-05-24T03:54:32+00:00

Using this SP I keep getting an error on the UPDATE statement indicating that

  • 0

Using this SP I keep getting an error on the UPDATE statement indicating that I have conversion problem or something. But ID is an integer in all of my tables….

Conversion failed when converting the varchar value ‘UPDATE tblLangenUS SET [lang_String] = ‘ – asdfgsdfg’, [prev_LangString] = ‘ ‘, [needsTranslation] = ‘false’ WHERE [ID] = ” to data type int.

    @currTable varchar(100),
    @ID int,
    @short_Text varchar(250),
    @brief_Descrip varchar(250) = Null,
    @needsTranslation varchar(10) = Null,
    @prev_LangString varchar(250) = Null,
    @lang_String varchar(250) = Null,
    @original_lang_String varchar(250) = Null,
    @StringID_from_Master varchar(250),     
    @GUID varchar(250) = Null

/*

*/

AS        
SET NOCOUNT ON;

DECLARE @userTable AS VARCHAR(200);
SET @userTable = @currTable
DECLARE @submitDate1 DATETIME;
SET @submitDate1 = GETDATE()



SET @prev_LangString = @original_lang_String
SET @needsTranslation = 'false'

DECLARE @sql varchar(max)
    -- Establish update to the language tabel of user and prepare to search DB for all strings that will need to be updated.
BEGIN

   SET @sql = 'UPDATE ' + @currTable + ' SET [lang_String] = ''' + @lang_String + ''', [prev_LangString] = ''' + @prev_LangString + ''', [needsTranslation] = ''' + @needsTranslation + ''' WHERE [ID] = ''' + @ID + '''; ' 
   EXEC @sql
   @sql = ''



END

BEGIN               
    DECLARE usedIN_DBScursor CURSOR
    FOR
    SELECT       tblUniquetblStringsMaster_ID, Database_Name, dbKeyID_ofStringName
    FROM         tblDBUsage
    WHERE        (tblUniquetblStringsMaster_ID = @StringID_from_Master );


                -- Declare the variables to store the values returned by FETCH.
    DECLARE @tblUniquetblStringsMaster_ID AS INT;
    DECLARE @dbKEYID as INT;
    DECLARE @dbName as varchar(100);

    OPEN usedIN_DBScursor;

    -- Perform the first fetch and store the values in variables.
    -- Note: The variables are in the same order as the columns
    -- in the SELECT statement. 

    FETCH NEXT FROM usedIN_DBScursor
    INTO @tblUniquetblStringsMaster_ID, @dbName, @dbKEYID;

    -- Check @@FETCH_STATUS to see if there are any more rows to fetch.
    WHILE @@FETCH_STATUS = 0
    BEGIN
    -- Update pending strings table with translation.           
        BEGIN
            INSERT INTO tblPendingDBUpdates
                                     (stringMasterID, databaseName, databaseStringID, englishText, foreignLangText, submitDate, GUID)
            VALUES        (@StringID_from_Master, @dbName, @dbKEYID, @short_Text, @lang_String, @submitDate1, @GUID);                                       
        END 
--      SET @sql = ''
    -- This is executed as long as the previous fetch succeeds.
        FETCH NEXT FROM usedIN_DBScursor
        INTO @tblUniquetblStringsMaster_ID, @dbName, @dbKEYID;
    END

    CLOSE usedIN_DBScursor;
    DEALLOCATE usedIN_DBScursor;    

END 



RETURN
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T03:54:33+00:00Added an answer on May 24, 2026 at 3:54 am

    If the ID is an int, you must CAST it to an nvarchar

    SET @sql = 'UPDATE ' + @currTable + ' SET [lang_String] = ''' + @lang_String + ''', [prev_LangString] = ''' + @prev_LangString + ''', [needsTranslation] = ''' + @needsTranslation + ''' WHERE [ID] = ''' + CAST(@ID as nvarchar(10)) + '''; '
    

    Otherwise, you are trying to add a string and an integer together, which won’t work.

    Notice this part:

       ' WHERE [ID] = ''' + CAST(@ID as nvarchar(10)) + '''
    

    I think you must also change your EXEC syntax to:

    EXEC(@sql)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to send SMTP e-mails using PHPMailer, but I keep getting this error
I'm using the Html Agility Pack and I keep getting this error. The remote
I am trying to cache these images using this code... But i keep getting
Since I have started using this site, I keep hearing about the Boost library.
I am using SQL Server Management studio and keep getting the same error, and
I'm trying to execute an Insert statement, but keep getting a Invalid object name
This might be easy, but I'm a JQuery dunce and keep getting errors! Basically,
I keep getting this error when trying to delete a record from my table.
I keep on getting this error when running one of my scripts; PHP Fatal
I keep it in single line, if it's short. Lately I've been using this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.