创建 use StudentManager go if exists(select * from sysobjects where name='usp_ScoreQuery4') drop procedure usp_ScoreQuery4 go create procedure usp_ScoreQuery4 --创建带参数的存储过程 @AbsentCount int output,--缺考总人数 @FailedCount int output,--不及格总人数 , as select Stu…
--创建存储过程create procedure proc_stu@sname varchar(20),@pwd varchar(50),@flag bit outputasif exists(select * from dt_manager m where m.user_name=@sname and m.password=@pwd)select @flag=1elseselect @flag=0go --调用DECLARE @return_value int EXEC proc_stu 'a…
服务端: function TServerMethods1.spExecOut(funcId, sqlId, inParams: OleVariant): OleVariant;var d: TfrmDB; procName: string; params: TFDParams; i, h: Integer;begin Result := null; d := DBPool.Lock; if not Assigned(d) then Exit; try try procName := frmBu…
CREATE PROCEDURE [dbo].[GetNameById] @studentid varchar(8), @studentname nvarchar(50) OUTPUT AS BEGIN SELECT @studentname=studentname FROM student WHERE studentid=@studentid if @@Error<>0 RETURN -1 else RETURN 0 END using (SqlConnection conn = new S…
CREATE PROCEDURE [dbo].[GetNameById] @studentid varchar(), @studentname nvarchar() OUTPUT AS BEGIN SELECT @studentname=studentname FROM student WHERE studentid=@studentid RETURN - else RETURN END using (SqlConnection conn = new SqlConnection(connStr)…