此代码用于运行并提取余额大于500美元的所有记录,但是当我运行代码时,它会显示列名而不显示数据。我尝试过多种方法并获得相同的结果。
Create Proc spBillingBlancedue
@hihgestBalancedue money
AS
begin
begin try
Select patients.PatientID, First_Name + ' ' + Last_Name AS Name, Billing.Claims, Payment, Balance, (Claims + Payment + Balance) as TotalBill
From Billing
Join Insurence_Billing
on Billing.BillingID = Insurence_Billing.BillingID
join Insurences
on Insurence_Billing.InsurenceID = Insurences.InsurenceID
join Patients
on Patients.PatientID = Insurences.PatientID
Where Balance > @hihgestBalancedue
end try
begin catch
Print 'Error!'
end catch
end
--test
Declare @checkAmount money;
Set @checkAmount = 500.00;
EXEC spBillingBlancedue @checkAmount