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
 SQL Server Development (2000)
 Stored Procedure Question

Author  Topic 

hameed
Starting Member

40 Posts

Posted - 2001-03-30 : 16:55:18
I have two tables: tblQuestForSuccess and tblUsers

On a form I am allowing a user to select from all the names (FirstName and LastName columns) in tblUsers table so that they can evaluate an employee. This completed evaluation form then goes into the tblQuestForSuccess table. So now I have a record with the author ID (name is in tblUsers) and associate being evaluated ID (name is in tblUsers).

Now an author cannot evaluate the same employee more than once, so the next time they come to the page to allow them to select an employee to evaluate, I want to check the tblQuestForSuccess for records with their ID and the evaluated associated ID and then show them a subset of the tblUsers list that does not include anyone they have already evaluated in the tblQuestForSuccess table.

This is my stored procedure in SQL Server, but I cannot get it to work:
____________________________________________________________________________
CREATE PROCEDURE [associates_I_have_evaluated]
@memberid int
,@associatename int

AS

SELECT tblUsers.QfsmembersID, tblUsers.FirstName, tblUsers.LastName
FROM tblQuestForSuccess, tblUsers
LEFT OUTER JOIN tblQuestForSuccess ON tblUsers.QfsmembersID = tblQuestForSuccess.AssociateAuthor
WHERE tblQuestForSuccess.AssociateAuthor = @memberid and tblQuestForSuccess.AssociateName = @associatename and tblQuestForSuccess.AssociateAuthor IS NULL
_________________________________________________________________________

This is the error message I get when I try to save the stored procedure:
'tblQuestForSuccess' and 'tblQuestForSuccess' have the same exposed names. Use corelation names to distinguish them.


   

- Advertisement -