如何自动删除数据 [英] how delete data automatically

查看:75
本文介绍了如何自动删除数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用vb.net和sql searver每天删除所有表数据???请帮帮我.tax

how Delete all table data day by day using vb.net and sql searver??? please help me.tax

推荐答案

亲爱的阿马尔,
在sqlcommand方法中编写delete查询并构建解决方案,您将在Bin文件夹中获得一个exe,然后在Windows Scheduler中将其分配为每天运行的一个.
F Y I,找到示例代码,
Dear Amal,
Write the delete query in sqlcommand method and build the solution, you''ll get one exe in Bin folder then assign this exe in windows scheduler as everyday running one.
F Y I, find the sample code,
dim con as new Sqlconnection("your connection string")
con.Open()
Dim cmd As New SqlCommand("delete from tablename", con)
cmd.ExecuteNonQuery()
con.Close()



问候,
Bluesathish



Regards,
Bluesathish


但是在自动删除数据时必须小心.归档旧数据,因为它有时很有用& ;;可以将您从可怕的情况中解救出来.
如何从生产数据库中存档数据? [
But you have to careful when you delete the data automatically. Archive the old data because it''s useful sometimes & it''ll save you from terrible situations.
How to archive data from my production databases?[^]


这篇关于如何自动删除数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆