I have table there is a status column when status is active
I have table there is a status column when status is active then data
not inserted otherwise insert. status depend on end date if enddate is
smaller than the today date then automatically status become unactive
and data will be inserted
Hemant SrivastavaPosted Oct 21, 2013, 9:07 AM
Hemant SrivastavaPosted Oct 16, 2013, 3:33 PM
DECLARE @TIME_FROM_TABLE DATETIME
SET @TIME_FROM_TABLE = (
SELECT UDT_TS AS TIMESTAMP
FROM TSTATUS
WHERE CNY_CD = 'US'
)
IF ((GETDATE()- @TIME_FROM_TABLE) > 0)
BEGIN
--SET THE STATUS COLUMN TO INACTIVE
--DO INSERT OPERATION
END
ELSE
BEGIN
--SET THE STATUS COLUMN TO ACTIVE
END
Jaganathan BantheswaranPosted Oct 16, 2013, 11:20 AM
Question is not clear. Please give some more detail.