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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Stored Procedures - Clear Table

Author  Topic 

ezramod
Starting Member

12 Posts

Posted - 2011-09-29 : 11:04:33
hello, sorry for my bad english and if i no post in corectly theard.
i have a table(quiz_assw) with to column account and ip, there i add account and ip every user acces a specify page, but i want to clear, delete all record, from this table(quiz_assw) every 24 hours, how can i do this, need stored procedures? have some example?
im beginer on mssql.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-09-29 : 12:58:59
just add a sql agent job and add a schedule to execute it every day once at a convenient time. the job should have a step which calls t-sql script which will be
TRUNCATE TABLE quiz_assw

I hope your table is not having any foreign keys
else you've to use below instead

DELETE FROM quiz_assw

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

ezramod
Starting Member

12 Posts

Posted - 2011-09-29 : 14:50:13
thanks verry much work with JOB.;)
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-09-30 : 00:58:44
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -