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!!
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!!