Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stored procedure help

Status
Not open for further replies.

crystalized

Programmer
Jul 10, 2000
390
CA
I have a stored procedure here it is:

Code:
Alter Procedure stpProjInternalTeam
	(
		@nFirmID int,
		@nProjID int
	)
As

	Select pitProjID,pitFirmID,pitID,pitTask,pitEmpID,femFullName as nameOf
	from tblProjInternalTeam,tblEmployee
	where	pitFirmID = @nFirmID and 
		     pitProjID = @nProjID and
		     femID=pitEmpID and
		     femFirmID=pitFirmID

	
	/* set nocount on */
	return

Now what I have been doing with stored procedures so far is using them in recordset objects using visual interdev. Now how it handles the underlying stuff I am not sure, but I am able to add records and update records etc with these recordsets.

This is the first stored procedure I have had where I have had to utilize two tables. Now the employee table is required to get the names only (I do not want to update or create any records in that table). I only want the ProjInternalTeam table to be updateable. Currently I recieve and error because it is trying to insert a record into the employee table (required fields are not provided).

I have seen a few things in the books online that make me think a cursor might be required (but I admit I know very little of cursors and so have been avoiding them). So before I leap to trying to learn cursors I was wondering if anyone has any suggestions as to whether it is possible to just make changes to my current procedure to correct the problem.

Thanks in advance for your help
 
It might be a little bit cleaner to do a join between the two tables. Regardless, in a view only one table can be updated. Its true this SP doesn't explicitly create a view, buy my WAG is that is what is happening in order to support your updatable recordset.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top