troubleshooting Question

basic stored procedure question microsoft sql

Avatar of mathburg
mathburg asked on
Microsoft SQL ServerMicrosoft Development
12 Comments1 Solution298 ViewsLast Modified:
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

)
AS
BEGIN
SELECT  COL_CD, ACCT, SUFFIX, BAL
 FROM tbl_LOAN WHERE ACCT=@ACCT
END

Execute GetLOAN2 WHERE ACCT LIKE 'xxxxxxx'
ASKER CERTIFIED SOLUTION
Aneesh
Database Consultant
Join our community to see this answer!
Unlock 1 Answer and 12 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 12 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros