I prefer to use different stored procedures to do different things.
CREATE PROCEDURE [dbo].usp_updatedata
(@id CHAR(12)
,@Date DATETIME
)
AS
BEGIN
Update Table_mocha
SET P4=LTRIM(RTRIM(Nullif(Replace(PE4,RTRIM(Cast(Q_ID as varchar(10))), ''),'')))
where id=@id and order_dt=@Date
End
CREATE PROCEDURE [dbo].usp_getData
(@id CHAR(12)
,@Date DATETIME
)
AS
BEGIN
SET NOCOUNT ON;
SELECT id, ln_id,p4, P9,P11
where id=@id and order_dt=@Date
End
No comments:
Post a Comment