November 5, 2011 at 5:40 am
Hi,
I've a table with run_time column with data type of datetime and description column with data type of nvarchar (1024)
i need to write a before trigger to check if the run_time and description exists in the table then rollback.
i can't put a unique index to both columns because i need to filter the run_time column that will compare to the date only and not the time.CONVERT(NVARCHAR(20),RUN_TIME,103)
how can i accomplish this?
THX
November 5, 2011 at 6:11 am
Can you add a computed persisted column based on the run_time column to hold the date value only and add a unique constraint to it?
Probably a better performing solution than the trigger approach...
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply