Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
ann
Posting Yak Master
220 Posts |
Posted - 2006-07-30 : 15:04:35
|
Is it possible to do a sp where I retreive the value from one table to update another? Example, I have a table that has users and another that has branch info. I need to select the user branch from the users table, then grab the branch info from the branch table:1. Select branchNo from users where userID = blah....2. Select * from branch where branchNo = branchNoIf it's possible, can anyone give me an example or direct me to where I can find more info on this?Thanks |
|
ann
Posting Yak Master
220 Posts |
Posted - 2006-07-30 : 15:13:35
|
I think I found what I'm looking for:USE pubsSELECT pub_nameFROM publishersWHERE pub_id IN (SELECT pub_id FROM titles WHERE type = 'business') |
 |
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-07-30 : 15:36:51
|
From your description it would be more likeselect u.name, b.namefrom users ujoin branch bon u.branchNo = b.branchNo==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|