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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Derived Table nightmare

Author  Topic 

tjoppie
Starting Member

4 Posts

Posted - 2006-06-08 : 09:50:05
Hi all,

I don't know if a derived table is the correct way to go, but let me explain what I need to do.

I've got a table called tNote, which captures notes.

There is a field called InitiatorID NVARCHAR(50), which get's filled with a GUID when the record get's added. Now the initiatorid can come from one of 2 tables which contains users.

My Select query, or stored procedure, needs to look in both tables for the user, and return the user First name in my query...

Any ideas on how to do this??
Thanks

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-06-08 : 10:14:56
can you post your table structure, some sample data and the result you want.


KH

Go to Top of Page

tjoppie
Starting Member

4 Posts

Posted - 2006-06-08 : 10:29:01
My tNote Table:
NoteID int
NoteDate datetime
NoteTypeID int
NoteText text
InitiatorID nvarchar(50)
RelationID nvarchar(50)

Data:
1 2006/06/08 13:51:15 1 Lead Added to System e553255e-4bf8-45b2-9797-c8febbbdf34b 527ae2bc-d761-42f4-8fd3-b33f0d3fb0b1

Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-06-08 : 10:32:35
"Now the initiatorid can come from one of 2 tables which contains users."
How about the 2 tables ?


KH

Go to Top of Page
   

- Advertisement -