I am writing a stored procedure in SQL Server 2008. Here I have a database table as
Id LastUpdateTime
1 2011-12-27 11:15:03.700
2 2011-12-27 11:16:03.700
3 2011-12-27 11:15:03.700
In my stored procedure, I want to check that
if (currentSystemTime - LastUpdateTime > 5 minute)
{
// some action
}
else
{
// some other action
}
But I am not getting how to do that. Please help me. Thanks in advance
Look at using the DateDiff function: