IF EXISTS (
SELECT
name
FROM
sysobjects
WHERE
name
= N
'dd_taItemSiteWrapper'
AND
type =
'P'
)
DROP
PROCEDURE
dd_taItemSiteWrapper
GO
CREATE
PROCEDURE
dd_taItemSiteWrapper
-- dd_taItemSiteWrapper 'mortarcovers~~','020',0
@ITEMNMBR
varchar
(30),
@LOCNCODE
varchar
(10),
@UpdateIfExists
int
AS
set
transaction
isolation
level
read
uncommitted
DECLARE
@O_iErrorState
INT
,
@oErrString
VARCHAR
(256),
@ErrorDesc
VARCHAR
(256)
SELECT
@O_iErrorState = 0
EXEC
taItemSite
@I_vITEMNMBR = @ITEMNMBR,
@I_vLOCNCODE = @LOCNCODE,
@I_vUpdateIfExists = @UpdateIfExists,
@O_iErrorState = @O_iErrorState
OUT
,
@oErrString = @oErrString
OUT
IF @O_iErrorState > 0
BEGIN
SELECT
@ErrorDesc = tec.ErrorDesc
FROM
dynamics..taErrorCode tec
WHERE
tec.ErrorCode = @O_iErrorState
END
ELSE
BEGIN
SELECT
@ErrorDesc =
''
end
SELECT
@O_iErrorState
AS
ErrorState, @oErrString
AS
ErrString, @ErrorDesc
AS
ErrorDesc
GO
grant
exec
on
dd_taItemSiteWrapper
to
public
-- sp_sps 't'