Home Forums SQL Server 2008 T-SQL (SS2K8) Need help to create function which is dynamically delete the data prior to 2014-07-15 and it should be happen every year without changing the query RE: Need help to create function which is dynamically delete the data prior to 2014-07-15 and it should be happen every year without changing the query

  • maheendra.puttareddy (5/27/2015)


    DELETE FROMtemp

    WHEREMSDate < '2014-07-15'

    Actually our business year starts from july 1st so we need to delete the data prior to july 15th of every year for this I need help to create function and it has to be deleted prior to current year

    Example the year starts from 2014-07-01 to 2015-06-30 is called 2015 year and it has variable upto july 15th

    Take a look at the function I posted in your other thread at http://www.sqlservercentral.com/Forums/Topic1685872-392-1.aspx. You can add whatever other columns you need.