I am very new with stored procedures. I have created this procedure GetLOAN2 and I can call the info by the execute statement below by manually putting in the ACCT. What I want to do is hand it the account number dynamically or from a query. How can I do this?
Thank you in advance
Create PROCEDURE GetLOAN2(
@ACCT VARCHAR(50) --Input parameter , Studentid of the student
SELECT COL_CD, ACCT, SUFFIX, BAL
FROM tbl_LOAN WHERE ACCT=@ACCT
Execute GetLOAN2 WHERE ACCT LIKE 'xxxxxxx'