SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Working with two tables
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Yak Posting Veteran

United Kingdom
68 Posts

Posted - 02/14/2013 :  04:06:45  Show Profile  Visit richardlaw's Homepage  Reply with Quote
I’m new to working with SP’s and am enjoying the challenge. I’ve previously coded all the business logic using C#, but I am finding there is a lot more I can do via SP’s.

I’ve recently been looking for a way to search one table (select * from tbl_Contacts Where CustID = 3), and then perform another action on another table. In other words, for every CustID that = 3, do X on another table. What would be the best way to approach this?

Thanks as always

James K
Flowing Fount of Yak Knowledge

3865 Posts

Posted - 02/14/2013 :  05:59:48  Show Profile  Reply with Quote
It depends on what that X that you want to do on another table is and how you want to relate that table with the tbl_Contacts. In most cases, you would do a join with table X. The table may be INNER JOIN or one of the OUTER JOINs. This page has a description and a few examples: http://www.w3schools.com/sql/sql_join.asp
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000