如何从SQL数据库中的表中删除整个数据

如何从SQL数据库中的表中删除整个数据

本文介绍了如何从SQL数据库中的表中删除整个数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hii朋友我有一些问题要删除数据库中的数据。我希望在表中的空数据库..我必须在谷歌搜索但我没有找到正确的答案,因为简单



...

...



预付款谢谢你



我尝试了什么:



i以这种方式尝试首先复制(某些)数据库数据并再次粘贴它与新名称相同的数据源,但在他们的数据..我想要空数据库我怎么能得到







CREATE PROCEDURE sp_DeleteAllData AS EXEC sp_MSForEachTable'ALTER TABLE? NOCHECK CONSTRAINT ALL'EXEC sp_MSForEachTable'ALTER TABLE? DISABLE TRIGGER ALL'EXEC sp_MSForEachTable'DELETE FROM?'EXEC sp_MSForEachTable'ALTER TABLE?检查CONSTRAINT ALL'EXEC sp_MSForEachTable'ALTER TABLE? ENABLE TRIGGER ALL'EXEC sp_MSFOREACHTABLE'CELECT * FROM?'去 - 查看更多:http://www.devx.com/dbzone/Article/40967#sthash.fv051CNG.dpuf





i已尝试此代码,但我没有得到我把我的数据库名称... plz帮助我

Hii friends i have some issue to delete the data in databse.i want empty database in in table ..i have to search in google but i didnt find correct answer as simply

...
...

advance thanks to you

What I have tried:

i tried in this way first i copy the (some) data base data and again paste it same data source with new name but in their data ..i want empty database how can i get



CREATE PROCEDURE sp_DeleteAllData AS EXEC sp_MSForEachTable 'ALTER TABLE ? NOCHECK CONSTRAINT ALL' EXEC sp_MSForEachTable 'ALTER TABLE ? DISABLE TRIGGER ALL' EXEC sp_MSForEachTable 'DELETE FROM ?' EXEC sp_MSForEachTable 'ALTER TABLE ? CHECK CONSTRAINT ALL' EXEC sp_MSForEachTable 'ALTER TABLE ? ENABLE TRIGGER ALL' EXEC sp_MSFOREACHTABLE 'SELECT * FROM ?' GO - See more at: http://www.devx.com/dbzone/Article/40967#sthash.fv051CNG.dpuf


i have try this code but i didnt get where i put the my database name..plz help me

推荐答案



这篇关于如何从SQL数据库中的表中删除整个数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 08:41