Home I've generated an sql file full of inserts but can't find any documentation of executing this script from a stored procedure
 I'm creating a stored procedure that will delete all the data in my database and then insert the data from my sql file. The reason I am using the delete and insert instead of a restore is because a restore requires that no one is connected to the database where as deleting and inserting allows people to still be connected. Stored Procedure: CREATE PROCEDURE DropAndRestore -- Add the parameters for the stored procedure here @filepath nvarchar(200) AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Insert statements for procedure here Exec sp_MSFOREACHTABLE 'delete from ? RESTORE DATABASE [landofbeds] -- These lines are what needs to be replaced FROM DISK = @FilePath -- END GO