EF creating procedures using ExecuteStoreCommand (running bulk scripts) <pre><code>SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- USP_TEST_SELECT -- ============================================= IF EXISTS (SELECT name FROM sysobjects WHERE name = 'usp_test_select' AND type = 'P') DROP PROCEDURE usp_test_select GO CREATE PROCEDURE usp_test_select @id int AS BEGIN SET NOCOUNT ON; SELECT * FROM MY_TABLE mt WHERE mt.id = @id END GO -- ********************************************** </code></pre> <p>I read this script from a textfile and would like to run it using EF <code>.ExecuteStoreCommand</code> (or any other execute method in EF).</p> <p>An exception is thrown : </p> <blockquote> <p><em>System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near 'GO'.<br> 'CREATE/ALTER PROCEDURE' must be the first statement in a query batch.</em></p> </blockquote> <p>The scripts (text file) which I am running is generated by SQL Server Management Studio and runs with success if executed there.</p>