How to create a stored procedure with columns from three different tables in SQL Server 2008? I'm a fresher and I would like to get some suggestions on how to create a stored procedure in which I have to select columns from three different tables. 2 columns customername and customercode from first table, loan type from second table and account number, status from 3rd table.
SELECT 
    C.customername 
    ,C.customercode
    ,L.[loan type] 
    ,S.[account number]
    ,S.status
FROM
    [first table] AS C
    INNER JOIN [second table] AS L
    ON C.customercode = L.customercode
    INNER JOIN  [3rd table] AS S
    ON S.customercode = C.customercode


This is only as a guidance; it is better to post some sample data and definitions.