4 Replies Latest reply: Dec 5, 2012 4:11 PM by tylerjameswilson RSS

    Simple passing parameters into stored procedure

      Hello all. I am trying to figure out how to correctly pass a variable created with an InputBox, into a SQL stored procedure.


      This particular stored procedure wants two parameters, one of which can be ignored in this case. My problem is that I get the 245 error saying it cannot convert my varchar variable to int.


      So I'm:


      • declaring a variable via an InputBox called 'LocationCode'
      • writing a simple stored procedure that has two parameters which is:


      SQL EXEC [ETTDS].[spLook] @parse_field='', @usid_facode='LocationCode';


      The user should enter a Location Code into the input box, and the reload should display the results in a multibox (for now; just trying to get this part to work) which is on the sheet already.


      So WHY is my variable being forced as a varchar, OR, is the stored procedure expecting a varchar and getting int? In which case the question is similar, how do I convert my variables to what the database is expecting to receive?


      Sorry I'm such a noob, very little SQL knowledge.