它成功插入了第一行,但没有插入任何其他行,尽管第二行没有主键冲突
我的aspx.cs
文件中的代码:
outputParVal = sqlCmd.Parameters[outputParName].Value;
outparameter
在存储过程中是---“结果”
CREATE PROCEDURE [dbo].[RecruiterProfileInsert]
@CompanyId int,
@CompanyName varchar(200),
@EmailId varchar(50) ,
@Password varchar(20) ,
@ContactNumber varchar(15),
@Website varchar(50),
@CompanyProfile varchar(2000),
@IsVerified bit,
@Result Tinyint OutPut
--@CreatedDate datetime ,
--UpdatedDate datetime
AS
BEGIN
-- Insert statements for procedure here
--check whether @CompanyName already exist or not if exist then return
IF EXISTS(SELECT Top 1 * FROM RecruiterProfile WHERE @CompanyId = LTRIM(RTRIM(@CompanyId)))
BEGIN
SET @Result = 0-- Already Exists
END
ELSE
BEGIN
INSERT INTO RecruiterProfile
(
CompanyId,
CompanyName,
EmailId ,
Password ,
ContactNumber,
Website ,
CompanyProfile ,
IsVerified,
CreatedDate
)
VALUES
(
@CompanyId,
@CompanyName,
@EmailId ,
@Password,
@ContactNumber,
@Website,
@CompanyProfile,
@IsVerified,
GetDate()
)
set @Result =1
return
END
END