Click here to Skip to main content
15,888,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Using one store procedure how to use multiple tables.


please send any example how to use one store procedure to use multiple tables.


Regards,

Narasiman P.
Posted
Comments
gvprabu 21-Apr-13 12:32pm    
U need to use more than one tables in single Procedure right... Check in Code Project Posts or Google.

1 solution

Sorry but your question is not absolutely clear.
Are you trying to access multiple tables via one single stored procedure .

This can be done easily by using JOINS within the SP.

If you want to return data from multiple tables having a similar structure but don't want to join them, you can use UNION.
E.g.
Create SP1 AS
SELECT Something FROM TableA
UNION
SELECT Something FROM TableB
 
Share this answer
 
Comments
Richard MacCutchan 20-Apr-13 11:07am    
It's a repost, see the earlier one.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900