我的问题应是这样的:
一堆sql语句,两个输入性变量jsource和jcurrent
不知道如何让sql server执行
一般是用ODBC
    如query1用法
但是我用ado
所以需要ado的一个组件,另在数据库中建好stored procedure  //思路对吧?
  现建好一个,命名为get_id
CREATE PROCEDURE get_id
(@jsource char(4),
 @jcurrent char(4)
) AS
begin
 delete from table_temp
DECLARE @f char(4) 
DECLARE @f1 char(4)
DECLARE @c char(4)
set @f =@jsource
SET @f1 =@jcurrent
WHILE EXISTS (SELECT * FROM table_outport
         WHERE junctionbox_ID = @f1)
 BEGIN
        SELECT @c = cable_ID
        FROM table_outport
        WHERE junctionbox_ID = @f1
        INSERT table_temp VALUES (@c)
        SELECT @f1 = junctionbox_ID
        FROM table_inport
        WHERE cable_ID = @c
        IF @f = @f1  
        BREAK 
        ELSE
        CONTINUE
  END
end    (这个试过,成功)   运行sql语句
   adoquery2.sql.text:='exec get_id :jsource :jcurrent';
   adoquery2.parameters.parambyname('jsource').value:='j1';
   adoquery2.parameters.parambyname('jcurrent').value:='j5';
   adoquery2.execsql;
运行时提示error
"adoquery2:parameter'jsource'not found"
问题是:是否adoquery2.sql.text:的语句错了,请教
另SET @f1 =@jcurrent和select @f1 =@jcurrent一样吗?