存储过程 
sp_outdata(@userid char(10))
select * form table where ID=@userid客户端程序
用TstoredProc 或Tquery
query1:Tquery
procedure getdata(userID:string);
var str_sql:stirng;
begin
  str_sql:='sp_outdata '+userid
  query1.close;
  query1.sql.clear;
  query1.sql.add(str_sql);
  query1.ExecSQL;
end;

解决方案 »

  1.   

    大家独没有使用TAdoStoredProc 
      

  2.   

    存储过程:
    CREATE PROC pGetID @userid char(10)
    AS
    SELECT * FROM table WHERE ID = @userid客户端
    在adosp的parameters属性中建立一个@userid的参数,设置好datatype和direction
    程序如下
    adosp.Close;
    adosp.Parameters.ParamByName('@userid').Value := userid;
    adosp.Prepared;//要不要都可以
    adosp.Open;
      

  3.   

    使用 TstoredProc 
    create proc dbo.dt_whocheckedout
            @userId int,
    as
      sql_statementselect * from tabeltmp where id = userId