如何在存储过程中为Fk创建变量 [英] How Do I Make Variable For Fk In Stored Procedures

查看:75
本文介绍了如何在存储过程中为Fk创建变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已声明变量名'@Seeker_Id'。变量名在查询批处理或存储过程中必须是唯一的。

----------------------------- -----------------------



The variable name '@Seeker_Id' has already been declared. Variable names must be unique within a query batch or stored procedure.
----------------------------------------------------

CREATE  procedure [dbo].[SP_Seeker_AddressInfo]
@Evn as int =Null
,@Region as varchar(300) =null
,@City as varchar(300) =null
,@Postal_Code as varchar(300) =null
,@Mobile as varchar(50) =null
,@Seeker_Id as varchar(300) =null
,@Created_At as varchar(300) =null
,@Seeker_Id as int  

as
begin
if @Evn =1
begin
insert into SU_Seeker_AddressInfo 
( Region
, City
,Postal_Code
,Mobile
,Seeker_Id
,Created_At)
values
( @Region
, @City
,@Postal_Code
,@Mobile
,@Seeker_Id
,@Created_At)
end

推荐答案

我看到了你宣布两次。下定决心。



I see that you declare it twice. Make up your mind.

,@Seeker_Id as varchar(300) =null
,@Created_At as varchar(300) =null
,@Seeker_Id as int  


这篇关于如何在存储过程中为Fk创建变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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