sukahati
03-29-2007, 09:33 PM
i have problem to return bit value. i have a stored procedure where it check the bit value wether it is 0 or 1 and do some query depends on the condition. it works fine if im not using dynamic db, but the problem is i have to change it to dynamic. it did not pass the value to itself. below is the sp if it is not dynamic
CREATE PROCEDURE [dbo].[SP_AccHolderDefaultView]
(
@CompID NVarChar(13),
@CheckCust bit OUTPUT
)
AS
BEGIN
SET NOCOUNT ON;
SELECT @CheckCust = d.is_Cust
FROM T_RefTable.DBO.Traders As d (NOLOCK)
INNER JOIN T_ceFinance.DBO.CustAcct As a (NOLOCK) ON a.code= d.trader --change by suyee
INNER JOIN Company As p(NOLOCK)ON p.CompanyCode=a.code
WHERE p.NewCompanyID=@CompID
IF @CheckCust= 1
Select d.name from T_RefTable.dbo.Traders as d inner join Company As p (NOLOCK) on p.CompanyCode=d.trader WHERE p.NewCompanyID='+''''+@CompID+''''+' AND p.IsDeleted=0
END
anybody can help on it?
CREATE PROCEDURE [dbo].[SP_AccHolderDefaultView]
(
@CompID NVarChar(13),
@CheckCust bit OUTPUT
)
AS
BEGIN
SET NOCOUNT ON;
SELECT @CheckCust = d.is_Cust
FROM T_RefTable.DBO.Traders As d (NOLOCK)
INNER JOIN T_ceFinance.DBO.CustAcct As a (NOLOCK) ON a.code= d.trader --change by suyee
INNER JOIN Company As p(NOLOCK)ON p.CompanyCode=a.code
WHERE p.NewCompanyID=@CompID
IF @CheckCust= 1
Select d.name from T_RefTable.dbo.Traders as d inner join Company As p (NOLOCK) on p.CompanyCode=d.trader WHERE p.NewCompanyID='+''''+@CompID+''''+' AND p.IsDeleted=0
END
anybody can help on it?