Andrew G (7/4/2013)
The DROP procedure statement refers to a different procedure:DROP PROCEDURE [dbo].[NIC_OA_GetPatientXRayReportsOut]
create PROCEDURE [dbo].[NIC_OA_GetPhysicianXRayReportsOut]
One is PatientXray, the other is PhysicianXray, change DROP statement to:
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[NIC_OA_GetPhysicianXRayReportsOut]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[NIC_OA_GetPhysicianXRayReportsOut]
GO
Don't you just love the NHS :w00t:
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden