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 |
|
osirisa
Constraint Violating Yak Guru
289 Posts |
Posted - 2009-07-08 : 13:55:19
|
I have a view that is connected to a Master Table. This view has the following Columns: App_Name----Approver_UserID------BackUp_UserID------HR Payroll MRobert02 TSmith01 There is another table called Active_Directory that contains the User_ID + Email Accounts. What I need to do is the following:App_Name----Approver_UserID---Approver_Mail ---BackUp_UserID------BackUP_Mal HR Payroll MRobert02 MRobert02@mynet.com TSmith01 TSmith01@mynet.com How can I join the Active_Directory Table with the View on both places Approver_UserID and BackUp_UserID so I can pass those values for the new two columns (Approver_Mail) and (BackUP_Mail)Thanks for the Help |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-07-08 : 13:59:47
|
| [code]CREATE VIEW yooutviewASSELECT m.App_Name,m.Approver_UserID,ad2.Email AS Approver_Mail,m.BackUp_UserID,ad1.Email AS BackUP_MalFROM Master mINNER JOIN Active_Directory ad1ON ad1.User_ID=m.BackUp_UserIDINNER JOIN Active_Directory ad2ON ad2.User_ID=m.Approver_UserID[/code] |
 |
|
|
|
|
|