Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/sql-server-2008/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server 2008 sql server、过程和功能_Sql Server 2008 - Fatal编程技术网

Sql server 2008 sql server、过程和功能

Sql server 2008 sql server、过程和功能,sql-server-2008,Sql Server 2008,我有一个Studentstatus表,它从student表中获取学生列表 我执行此过程是为了更新或创建新记录,但出现以下错误: 过程或函数SaveAdvStudStata指定的参数太多 当您尝试使用该函数时,是否会出现该错误?您可以将脚本发布到您试图使用它的地方吗?看起来您没有提供正确数量的参数。这通常意味着您试图使用错误数量的参数执行存储过程(或udf)。检查执行代码。当您尝试使用该函数时是否出现该错误?您可以将脚本发布到您试图使用它的地方吗?看起来您没有提供正确数量的参数。这通常意味着您试图

我有一个Studentstatus表,它从student表中获取学生列表

我执行此过程是为了更新或创建新记录,但出现以下错误:

过程或函数SaveAdvStudStata指定的参数太多


当您尝试使用该函数时,是否会出现该错误?您可以将脚本发布到您试图使用它的地方吗?看起来您没有提供正确数量的参数。这通常意味着您试图使用错误数量的参数执行存储过程(或udf)。检查执行代码。当您尝试使用该函数时是否出现该错误?您可以将脚本发布到您试图使用它的地方吗?看起来您没有提供正确数量的参数。这通常意味着您试图使用错误数量的参数执行存储过程(或udf)。检查执行代码。
CREATE PROCEDURE [dbo].[SaveAdvStudStata]
@studentId int,
@stata int,
@description varchar(MAX),
@date DATE,
@issuedBy nvarchar(128)

AS 
BEGIN
if exists (select StudentId
           from dbo.StudentStata
           where StudentId = @studentId
          )
        begin
            Update dbo.StudentStata
            set Stata = @stata
               ,Description = @description
               ,Date = @date
               ,IssuedBy = @issuedBy
            where StudentId = @studentId
        end
    else
        begin
            Insert into dbo.StudentStata(StudentId
                                        ,Stata
                                        ,Description
                                        ,Date
                                        ,IssuedBy
                                        )
            VALUES (@studentId
                   ,@stata
                   ,@description
                   ,@date
                   ,@issuedBy
                   )
        end
END