How to use views inside the stored procedureI have created views,Views as follows
select cr.stud_id, stud_Name = (select stud_name from student where stud_id = cr.stud_id),
cbm.cmn_minor_code as Course,
RegType = case when isnull(cr.cr_bill_type,'') = 'C' then 'Course'
when isnull(cr.cr_bill_type,'') = 'P' then 'Package' else isnull(cr.cr_bill_type,'') end,
Paymenttype = case when isnull(cr.cr_reg_type,'') = '' then 'Not Paid'
when isnull(cr.cr_reg_type,'') = null then 'Not Paid'
else '' end,
pendingamt = (select top 1 isnull(b.bill_pend_amt,'') from bill_file b where
b.cr_bill_no = cr.cr_bill_no and b.bill_active <> 'D')
from course_registration cr, batch_course_registration bcr, co_batch_master cbm
where bcr.cr_bill_no = cr.cr_bill_no and cr.cr_active = 'A'
and bcr.bcr_batch_id = cbm.cbm_batch_id
and cr.cmj_major_code <> 'PSTF'
and isnull(cr.cr_reg_type,'') <> 'C'
The view name as follows
i want to use above views(Views_Fees_Pedning) inside the stored procedure.
for that how can i do in stored procedure.
please help me.