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.
Author |
Topic |
wsilage
Yak Posting Veteran
82 Posts |
Posted - 2013-04-16 : 11:30:16
|
Hi,I know how to drop and create a table, but I was wondering if there was a way to drop a table and recreate the table when it hits the beginning of each month. If so, how would I write that in my store Procedure? |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-04-16 : 11:36:35
|
yep...you'll write it in same was as DROP and CREATEonly difference is you'll create a sql server agent job and call the store procedure from itThen schedule the job to be executed monthly by giving a suitable date.------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
 |
|
wsilage
Yak Posting Veteran
82 Posts |
Posted - 2013-04-16 : 11:44:16
|
oh okay, thanks! |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-04-16 : 11:53:30
|
welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
 |
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2013-04-16 : 12:26:34
|
Why? Just to clear it out? Use TRUNCATE TABLE <table name> for that. |
 |
|
|
|
|