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 487621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:37:26+00:00 2026-05-13T01:37:26+00:00

I hope somebody can help me here, I have a table that has the

  • 0

I hope somebody can help me here, I have a table that has the name of the Stored Procedure that I would like to run, it also has a parameter that I would like to pass through into the Stored procedure.

declare @RowCnt int
declare @MaxRows int
declare @ExecSql nvarchar(255)

select @RowCnt = 1

These next two rows are specific to source table or query

I create a temporary table in that just has the information that i require

declare @Import table (
rownum int IDENTITY (1, 1) 
Primary key NOT NULL , 
LOB_ID int, 
LOB_Level varchar(25), 
LOB_WS varchar(50)
)

insert into @Import (LOB_ID,LOB_Level,LOB_WS) 

SELECT     LOB_ID, LOB_BODLevel, LOB_Parameters
FROM         view_LOB_Update_Mappings

select @MaxRows=count(*) from @Import

Now I want to run through the temporary table passing through the variables of stored procedure name LOB_Level

LOB_ID -> this used to be a Varchar, but I had to change and ever since this code no longer works

LOB_WS – Which is the 2nd parameter

while @RowCnt <= @MaxRows
begin

    select @ExecSql = 'exec ' + LOB_Level + ' ' + LOB_ID + ',' +  ' ''' + LOB_WS + '''' from @Import where rownum = @RowCnt 
    execute sp_executesql @ExecSql

   Select @RowCnt = @RowCnt + 1

end

The error message that I get is:

Msg 245, Level 16, State 1, Line 25
Syntax error converting the varchar value 'exec Update_LOB_Mappings_L35 ' to a column of data type int.

Any help that you can provide would be greatly appreciated!

John

  • 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-13T01:37:26+00:00Added an answer on May 13, 2026 at 1:37 am

    I think you need to convert LOB_ID to a string before you try to use it at line 25. In mysql this could be CONVERT(LOB_ID, CHAR(8))

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a problem with jquery/visible. Hope somebody can help me. This code works,
I have configured FBA on Sharepoint 2010 site. And its working fine when I
we needed to convert CVS to GIT yesterday. Everything went fine except that I
I'd need help with a simple implementation of a ViewFlipper. The flipper works perfect
I'm writing a simple booking program for a car rental (a school assignment). Me
In my Android app, each activity is filled with data from an xml file
I am developing a soundboard application in which I use Listview Activity. But since
I am developing a soundboard application in which I use Listview Activity. But since
I tried to use the ZipKit framework ( http://bitbucket.org/kolpanic/zipkit/wiki/UsingZipKit ) in the test application
I reinstalled my computer and tried now to import my Android project into the

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.