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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create sp to update foreign key identity columns

Status
Not open for further replies.

LTusing

Technical User
Oct 5, 2005
20
US
I am trying to create a stored procedure that I can call when I have completed data entry for the assessments that occurred for a patient at a visit. I want the stored procedure to update the tbl_Patient_Visit with the FK identity columns found in each assessment table.

Thus far I have something like...
Create Procedure (update_Patient_Visit)
(@v_id [int],
@testa [int],
@testb [int])

AS UPDATE [database].[dbo].[Patient_Visit)

SELECT @IDENT_CURRENT('testa')
SELECT @IDENT_CURRENT('testb')

WHERE v_id = v_id

GO

I know there are considerable errors, especially since I wish to specify that the tbl_patient_visit.v_id = tbl_testa.v_id.

Any guidance would he extremely helpful. Thank you!!
 
Please disregard this post, I have read a few other postings which explained how update queries work with .adp databases and I think that update queries will be the best way to accomplish the task. Thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top