L
Leeor Chernov
I am using ExecuteScalar, executing a stored procedure with two commands:
the first command is Select command,
and the second is Insert.
Because of the Select command , The ExecuteScalar do not return an error in case of the Insert(second command -see the stored pro. sample in the bottom) failure.
the stored procedure:
CREATE PROCEDURE dbo.usp_UpdateOnline
@Id as bigint,
@source_file as nvarchar(50),
AS
declare @IsUpdate as int
EXEC @IsUpdate = mysp_IsIDExist @Id
SELECT @IsUpdate
--From this point no error is returned to Execue Scalar
INSERT
INTO online.dbo.T_all
(Id,
source_file ,
)
VALUES
( @Id
,@source_file
)
GO
please help
Leeor
the first command is Select command,
and the second is Insert.
Because of the Select command , The ExecuteScalar do not return an error in case of the Insert(second command -see the stored pro. sample in the bottom) failure.
the stored procedure:
CREATE PROCEDURE dbo.usp_UpdateOnline
@Id as bigint,
@source_file as nvarchar(50),
AS
declare @IsUpdate as int
EXEC @IsUpdate = mysp_IsIDExist @Id
SELECT @IsUpdate
--From this point no error is returned to Execue Scalar
INSERT
INTO online.dbo.T_all
(Id,
source_file ,
)
VALUES
( @Id
,@source_file
)
GO
please help
Leeor