Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Working with two tables
 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

3873 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:
Go to Top of Page
  Previous Topic Topic Next 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.02 seconds. Powered By: Snitz Forums 2000