This is a multi-part message in MIME format.
------=_NextPart_000_00C5_01C73ED8.A6B50E10
Content-Type: text/plain;
charset="iso-8859-8-i"
Content-Transfer-Encoding: quoted-printable
I am using ExecuteScalar, executing a stored procedure with two =
commands:
the first command is Select command,=20
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 =3D mysp_IsIDExist @Id
SELECT @IsUpdate
--From this point no error is returned to Execue Scalar
INSERT=20
INTO online.dbo.T_all
(Id,
source_file ,
)
VALUES
( @Id
,@source_file
)
GO
please help
Leeor
------=_NextPart_000_00C5_01C73ED8.A6B50E10
Content-Type: text/html;
charset="iso-8859-8-i"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML dir=3Drtl><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-8-i">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY dir=3Dltr>
<DIV><FONT face=3DArial size=3D2>I am using ExecuteScalar, executing a =
stored=20
procedure with two commands:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>the first command is =
<STRONG>Select</STRONG>=20
command, </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>and the second is=20
<STRONG>Insert</STRONG>.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Because of =
the <STRONG>Select</STRONG> command=20
, The ExecuteScalar do not return an error in case of the=20
<STRONG>Insert(second command -see the stored pro. sample in the=20
bottom)</STRONG> failure.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>the stored procedure:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>CREATE PROCEDURE =20
dbo.usp_UpdateOnline</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>@Id as bigint,<BR>@source_file as=20
nvarchar(50),</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>AS<BR>declare @IsUpdate as int<BR>EXEC =
@IsUpdate =3D=20
mysp_IsIDExist @Id</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>SELECT @IsUpdate</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><STRONG>--From this point no error is =
returned to=20
Execue Scalar<BR></STRONG>INSERT <BR> INTO =
online.dbo.T_all<BR> =20
(Id,<BR> source_file ,<BR> )</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> VALUES<BR> ( =
@Id<BR> =20
,@source_file<BR> )</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>GO<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>please help</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Leeor</DIV></FONT></BODY></HTML>
------=_NextPart_000_00C5_01C73ED8.A6B50E10--