<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Executing a SQL script using ADO.NET</title>
	<atom:link href="http://www.mattberther.com/2005/04/11/executing-a-sql-script-using-adonet/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mattberther.com/2005/04/11/executing-a-sql-script-using-adonet/</link>
	<description>Agile Manager and Occasional Code Monkey</description>
	<pubDate>Sat, 06 Sep 2008 04:43:06 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: Mihai</title>
		<link>http://www.mattberther.com/2005/04/11/executing-a-sql-script-using-adonet/#comment-165617</link>
		<dc:creator>Mihai</dc:creator>
		<pubDate>Thu, 03 Apr 2008 00:05:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattberther.com/blog/?p=619#comment-165617</guid>
		<description>Like all quick regex solutions intended to match productions of fairly complex languages, this can fail miserably if a different kind of GO is placed alone in one line. It could be part of a string (if T-SQL allows multiline strings, or it could be a column in a table).

I think having to make your commands single-line (which would incidentally fix the issue I mentioned) would be a terrible chore.

The bottom-line here is that you don't want to write something that can come and bite you in the ass at an unknown time in the future. This tool is only guaranteed to work in synergy with a policy: "make sure all the GOs matchable by this regex in all the scripts are really those GOs...". And you know, that's a policy you don't want.

Anyway, I'm sure the life of many is easier now, but at some point, somewhere, someone's script is gonna blow and someone will have to go back to massage it. Hopefully not the client :)</description>
		<content:encoded><![CDATA[<p>Like all quick regex solutions intended to match productions of fairly complex languages, this can fail miserably if a different kind of GO is placed alone in one line. It could be part of a string (if T-SQL allows multiline strings, or it could be a column in a table).</p>
<p>I think having to make your commands single-line (which would incidentally fix the issue I mentioned) would be a terrible chore.</p>
<p>The bottom-line here is that you don&#8217;t want to write something that can come and bite you in the ass at an unknown time in the future. This tool is only guaranteed to work in synergy with a policy: &#8220;make sure all the GOs matchable by this regex in all the scripts are really those GOs&#8230;&#8221;. And you know, that&#8217;s a policy you don&#8217;t want.</p>
<p>Anyway, I&#8217;m sure the life of many is easier now, but at some point, somewhere, someone&#8217;s script is gonna blow and someone will have to go back to massage it. Hopefully not the client :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://www.mattberther.com/2005/04/11/executing-a-sql-script-using-adonet/#comment-165227</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Tue, 06 Nov 2007 20:22:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattberther.com/blog/?p=619#comment-165227</guid>
		<description>The script above is already tied to a database, even without using  SMO. Structures like SqlCommand and SqlTransaction are specific ado.net implementations for MS Sql Server. You could make an argument that using SMO would not allow this script to execute for a different flavor of MS Sql Server. If you want a true data agnostic implementation either us ADO.Net's provider model (DbCommand, DbTransaction) or us the more generic Provider Model pattern.</description>
		<content:encoded><![CDATA[<p>The script above is already tied to a database, even without using  SMO. Structures like SqlCommand and SqlTransaction are specific ado.net implementations for MS Sql Server. You could make an argument that using SMO would not allow this script to execute for a different flavor of MS Sql Server. If you want a true data agnostic implementation either us ADO.Net&#8217;s provider model (DbCommand, DbTransaction) or us the more generic Provider Model pattern.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Berther</title>
		<link>http://www.mattberther.com/2005/04/11/executing-a-sql-script-using-adonet/#comment-157757</link>
		<dc:creator>Matt Berther</dc:creator>
		<pubDate>Tue, 16 Oct 2007 14:29:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattberther.com/blog/?p=619#comment-157757</guid>
		<description>@dave: I didnt have it open the connection because the connection was passed in. The assumption was the that method that calls this had already opened the connection.</description>
		<content:encoded><![CDATA[<p>@dave: I didnt have it open the connection because the connection was passed in. The assumption was the that method that calls this had already opened the connection.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Coates</title>
		<link>http://www.mattberther.com/2005/04/11/executing-a-sql-script-using-adonet/#comment-157522</link>
		<dc:creator>Dave Coates</dc:creator>
		<pubDate>Tue, 16 Oct 2007 07:48:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattberther.com/blog/?p=619#comment-157522</guid>
		<description>U ROK!! Saved my life and LOTS of hours of searching...i changed it to so that it opens the connection tho, cause its not there...just in case u want to add that..</description>
		<content:encoded><![CDATA[<p>U ROK!! Saved my life and LOTS of hours of searching&#8230;i changed it to so that it opens the connection tho, cause its not there&#8230;just in case u want to add that..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mahammed Ali Shaik</title>
		<link>http://www.mattberther.com/2005/04/11/executing-a-sql-script-using-adonet/#comment-151056</link>
		<dc:creator>Mahammed Ali Shaik</dc:creator>
		<pubDate>Mon, 24 Sep 2007 14:29:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattberther.com/blog/?p=619#comment-151056</guid>
		<description>Just what I was looking for. Thanks!

Any one tell, how to generate scripts with data ...

Thanks in adv..

@li</description>
		<content:encoded><![CDATA[<p>Just what I was looking for. Thanks!</p>
<p>Any one tell, how to generate scripts with data &#8230;</p>
<p>Thanks in adv..</p>
<p>@li</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin</title>
		<link>http://www.mattberther.com/2005/04/11/executing-a-sql-script-using-adonet/#comment-147142</link>
		<dc:creator>Justin</dc:creator>
		<pubDate>Fri, 31 Aug 2007 01:32:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattberther.com/blog/?p=619#comment-147142</guid>
		<description>I am getting errors if my stored procedure has any comment marks in it "--" has anyone run into this is there a way around this so i can run a sql script just like i would in query analyzer to create stored procedure</description>
		<content:encoded><![CDATA[<p>I am getting errors if my stored procedure has any comment marks in it &#8220;&#8211;&#8221; has anyone run into this is there a way around this so i can run a sql script just like i would in query analyzer to create stored procedure</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://www.mattberther.com/2005/04/11/executing-a-sql-script-using-adonet/#comment-126518</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Sun, 22 Jul 2007 05:06:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattberther.com/blog/?p=619#comment-126518</guid>
		<description>I would suspect that you just wrap the calls in a try/catch. Something like that would probably come back as an exception.</description>
		<content:encoded><![CDATA[<p>I would suspect that you just wrap the calls in a try/catch. Something like that would probably come back as an exception.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sooryanarayan</title>
		<link>http://www.mattberther.com/2005/04/11/executing-a-sql-script-using-adonet/#comment-126511</link>
		<dc:creator>Sooryanarayan</dc:creator>
		<pubDate>Sun, 22 Jul 2007 05:02:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattberther.com/blog/?p=619#comment-126511</guid>
		<description>HOw do you get back the response/messages the SQL generates while executing. FOr example : SQL Server generates the following message for dependancy SP

Cannot add rows to sysdepends for the current object because it depends on the missing object 'uspTestDep'. The object will still be created.

I want to display on .NET screen.

Do you have any ideas?</description>
		<content:encoded><![CDATA[<p>HOw do you get back the response/messages the SQL generates while executing. FOr example : SQL Server generates the following message for dependancy SP</p>
<p>Cannot add rows to sysdepends for the current object because it depends on the missing object &#8216;uspTestDep&#8217;. The object will still be created.</p>
<p>I want to display on .NET screen.</p>
<p>Do you have any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bees</title>
		<link>http://www.mattberther.com/2005/04/11/executing-a-sql-script-using-adonet/#comment-101016</link>
		<dc:creator>Bees</dc:creator>
		<pubDate>Thu, 21 Jun 2007 17:14:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattberther.com/blog/?p=619#comment-101016</guid>
		<description>works great, one thing, If you run a script that create and or drop tables you have to remove the Transaction section.</description>
		<content:encoded><![CDATA[<p>works great, one thing, If you run a script that create and or drop tables you have to remove the Transaction section.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Wentz</title>
		<link>http://www.mattberther.com/2005/04/11/executing-a-sql-script-using-adonet/#comment-91813</link>
		<dc:creator>Jonathan Wentz</dc:creator>
		<pubDate>Mon, 11 Jun 2007 21:44:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattberther.com/blog/?p=619#comment-91813</guid>
		<description>Here's an updated regular expression that will handle white space around the GO keyword:
^\s*GO\s*$</description>
		<content:encoded><![CDATA[<p>Here&#8217;s an updated regular expression that will handle white space around the GO keyword:<br />
^\s*GO\s*$</p>
]]></content:encoded>
	</item>
</channel>
</rss>
