14 November 2011

Empty all table values in the Database


Empty all table values in the Database

CREATE PROCEDURE SP_EmplyAllTableValues
AS
EXEC sp_MSForEachTable 'ALTER TABLE ? NOCHECK CONSTRAINT ALL'
EXEC sp_MSForEachTable 'DELETE FROM ?'
EXEC sp_MSForEachTable 'ALTER TABLE ? CHECK CONSTRAINT ALL'
GO

exec SP_EmplyAllTableValues

No comments:

Post a Comment

Comments Welcome

Find number of letter occurence of all letter in c#

  Find number of letter occurence of all letter in c#  namespace ConsoleApp1 {     internal class Program     {         static void Main(st...