如何使用存储过程删除多个表中的所有记录 [英] how to delete all records in multiple tables using stored procedure

查看:118
本文介绍了如何使用存储过程删除多个表中的所有记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用存储过程删除多个表中的所有记录。



i有3个表

数据(lot_no,类型,形状,大小,地方,重量,dt)

sort(lot_no,名称,类型,形状,大小,地点,重量,issue_dt)

fullsort(lot_no,名称,类型,形状) ,大小,地点,重量,issue_dt,return_dt)



这里所有列都是常见的,除了name,dt,issue_dt,return_dt。

name和issue_dt存在于sort和fullsort表中,而不存在于数据表中。

return_dt列存在于fullsort表中但在其他表中不存在



现在我想删除所有表中所有列的所有记录,使用vb.net中的1删除按钮和后端使用存储过程。



我该怎么做?



任何人都可以帮我。

how to delete all records in multiple tables using stored procedure.

i have 3tables
data(lot_no,type,shape,size,place,weight,dt)
sort(lot_no,name,type,shape,size,place,weight,issue_dt)
fullsort(lot_no,name,type,shape,size,place,weight,issue_dt,return_dt)

here all the columns are common except name,dt,issue_dt,return_dt.
name and issue_dt is present in sort and fullsort table which is not there in data table.
return_dt column is present in fullsort table but absent in other tables

now i want to delete all the records of all the columns of all the tables using 1 delete button in vb.net and at back end using stored procedure.

how do i do it?

can anyone help me please.

推荐答案

没有命令从多个表中删除数据。唯一的选择是单独删除它们。
There is no command to delete data from multiple tables. Only option is to delete them individually.


这篇关于如何使用存储过程删除多个表中的所有记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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