samedi 30 janvier 2016

SQL Stored procedure returning resulr ROw Multiple time it shows 1 rows to 3 times

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[PrintQuickBill](@BillNo int)
as
SELECT  
A.BillNo, 
A.BillDate, 
A.CustomerName, 
A.Address, 
A.CustomerId, 
A.BillLaborAmt, 
A.BillPartAmt, 
A.ServTaxAmt, 
A.VatAmt,
A.BillNetAmt,

FROM         
dbo.tblQuickBillMain A

INNER JOIN
[dbo].tblQuickBillLabor L ON A.BillNo = L.BillNo
 INNER JOIN
 [dbo].tblQuickBillParts P ON  A.BillNo = P.BillNo
CROSS JOIN
dbo.CompanyInfo
where A.BillNo=@BillNo
order by CustomerName.

// this stored procedure returning result in multiple form like if I have 1 // record the result shows 3 times. // If I take BillNo=1 then it should retun only one row but it retun 3 row //which are identical means billNo 1 is shows three times with respective data.

Aucun commentaire:

Enregistrer un commentaire