在执行插入查询时,我得到了无限循环(我认为是这样)。它永远不会结束。以下是我的查询
ALTER proc [dbo].[InsertNomineeImage]
@UserId int,
@ContestId int,
@ImagePath varchar(150),
@Name varchar(50),
@Description varchar(500)
As
BEGIN
Begin TRY
BEGIN TRAN
Declare @Id as int
insert into UserImages(UserId,ImagePath,Name,Description,IsActive)
values(@UserId,@ImagePath,@Name,@Description,'False')
set @Id=SCOPE_IDENTITY();
Insert into UserContestImages(UserId,ContestId,UserImage,ParticipationDate,IsActive)
values (@UserId,@ContestId,@Id,GETDATE(),'False')
COMMIT TRAN
END TRY
BEGIN CATCH
IF @@ERROR > 0
ROLLBACK TRAN
END CATCH
End