Click here to Skip to main content
15,896,512 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
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
Posted
Updated 23-Aug-16 19:58pm

 
Share this answer
 
i tried above link sir..but did'nt get the empty data ...some tables have data
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900