sql server存储过程需要未提供的参数 [英] sql server stored procedure expects parameter which was not supplied

查看:532
本文介绍了sql server存储过程需要未提供的参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





i我的程序有问题



mt proc



  USE  [GLDB] 
GO
/ * *****对象:StoredProcedure [dbo]。[ADM_GROUPInsert]脚本日期:07/07/2013 12:53:06 ****** /
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo ]。[ADM_GROUPInsert]

@ GROUP_ID int
@ G ROUP_NAME varchar 50


AS

SET NOCOUNT ON

INSERT INTO [ADM_GROUPS]

[GROUP_ID],
[GROUP_NAME]


VALUES

@ GROUP_ID
@ GROUP_NAME





当我尝试执行它时会出现此错误



消息 201 ,等级 16 ,状态 4 过程 ADM_GROUPInsert,行 0  
程序 function ' ADM_GROUPInsert需要参数 @ GROUP_ID',这是< span class =code-keyword> not 提供。



ant one帮助我

解决方案

< blockquote>错误消息非常明确:

过程或函数'ADM_GROUPInsert'需要参数'@GROUP_ID',这是未提供的。

问题不在您的代码中,如图所示 - 它与您调用该过程的方式有关。当你这样做时,你还没有提供参数!



我们无法帮助你通过查看程序对它进行排序 - 它需要一个提供给工作的参数。看看你称之为的代码!


你的代码清楚地表明它需要两个参数



@GROUP_ID

@GROUP_NAME



组ID在INT中,为整数。检查它是否是自动增量(在列设计中),您必须在插入时传递它。或者将其设置为自动增量,您需要将其作为参数传递。



你必须运行查询



ADM_GROUPInsert 10'GRP NME'



它将在groupid和GRP NME的groupname列中插入10个。


Hi

i have a problem with my procedure

mt proc

USE [GLDB]
GO
/****** Object:  StoredProcedure [dbo].[ADM_GROUPInsert]    Script Date: 07/07/2013 12:53:06 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[ADM_GROUPInsert]
(
	@GROUP_ID int,
	@GROUP_NAME varchar(50)
)

AS

SET NOCOUNT ON

INSERT INTO [ADM_GROUPS]
(
	[GROUP_ID],
	[GROUP_NAME]

)
VALUES
(
	@GROUP_ID,
	@GROUP_NAME

)



and when i try to execute it get this error

Msg 201, Level 16, State 4, Procedure ADM_GROUPInsert, Line 0
Procedure or function 'ADM_GROUPInsert' expects parameter '@GROUP_ID', which was not supplied.


ant one help me

解决方案

The error message is pretty explicit:

Procedure or function 'ADM_GROUPInsert' expects parameter '@GROUP_ID', which was not supplied.

The problem is not in your code as shown - it has to do with how you call the procedure. When you do, you have not supplied the parameter!

We cannot help you to sort this by looking at the procedure - it needs a parameter supplied to work. Look at the code with which you call it!


your code clearly states that it needs two parameters

@GROUP_ID
@GROUP_NAME

Group ID is in INT, as integer. Check it is autoincrement or not (in Column design), You have to pass it while inserting. or Make it as auto increment and you need to pass that as argument.

You have to run the query as

ADM_GROUPInsert 10 'GRP NME'

it will insert 10 in groupid and GRP NME in groupname columns.


这篇关于sql server存储过程需要未提供的参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆