Need Help - TechRepublic
Question
October 21, 2009 at 11:24 PM
evga

Need Help

by evga . Updated 16 years, 8 months ago

I am really new to Programing in SQL and trying to figure this nature out.

I am working on this statement below but cannot get it two work. I am always getting some kind of error. Any help on if there is some kind of Store Procedure like this that would work would be great.

SET ANSI_NULLS ON
GO

Create PROCEDURE [dbo].[TP__DischargeProgram]

AS

Declare
@PRGDISCHARGEDATE DATETIME,
@ADMISSIONKEY INT,
@CLIENTKEY INT,
@TIMEDISCHARGE DATETIME

IF @PRGDISCHARGEDATE <> NULL AND @TIMEDISCHARGE <> Null
Begin
UPDATE FD__AGENCY_ADMISSION SET DISCHARGE_DATE = @PRGDISCHARGEDATE, DISCHARGE_TIME =@TIMEDISCHARGE, Admission_Status = ‘I’
WHERE CLIENTKEY = @CLIENTKEY AND ADMISSIONKEY= @ADMISSIONKEY
END

This discussion is locked

All Comments