Stored Procedures not working in Server Explorer
I have a stored procedure as follows:
(@PatientID as varchar, @dateIn as datetime)
AS
SELECT
MriPatients.PatientID AS PatientID,
MriPatients.Name AS Name,
SchAppointments.Status AS Status,
SchAppointments.AppointmentTypeID AS AppTypeID,
SchAppointments.TypeDescription,
SchAppointments.DateTime,
SchAppointments.VisitID,
SchEncounterForm.[Encounter Form],
SchEncounterForm.Description
FROM
MriPatients INNER
JOIN
SchAppointments ON
MriPatients.SourceID = SchAppointments.SourceID AND
MriPatients.PatientID = SchAppointments.PatientID INNER JOIN
SchEncounterForm ON SchAppointments.AppointmentTypeID = SchEncounterForm.[Appt Type]
WHERE
(MriPatients.PatientID = @PatientID) AND
(SchAppointments.Status = 'BOOKED') AND
(CONVERT(char(10) , SchAppointments.DateTime , 101) = @dateIn)
This Procedure should return one row for a patient Appointment. In Query analyzer the query runs as expected and returns one row. In the VS IDE using Servr Explorer no rows are returned. Does anyone know why this wont work in Server Explorer. I suspect it is something simple like a dataType but I am only using two parameters.
|