Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL Server 2012 -stored proc issue URGENT

Author  Topic 

Seuss
Starting Member

5 Posts

Posted - 2014-05-27 : 17:16:02
Hi all,

I am in desperate need of help please.

I have created a stored procedure with a while loop using a hard coded date 31-12-2014 to compare against current date produced in a while loop. I need to make the hard coded date reflect every two years i.e. 31-12-2016, 31-12-2018 etc.
How can the date be automatic instead of hard coded please?
i.e While (currdate <= '31-12-2014')

Second issue, how do I make the stored procedure to run every two years as well?

SQL Agent Job doesn't have a yearly frequency at all.

Can someone please offer an example coding and suggestions to those two issues which I will be grateful please.


Thank You!

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-05-27 : 17:33:56
Locking this duplicate topic.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -