<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>tewari &#187; sql</title>
	<atom:link href="http://www.tewari.info/category/sql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tewari.info</link>
	<description>Professional Software Development by Ash Tewari</description>
	<lastBuildDate>Thu, 03 Jun 2010 01:52:16 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using DbUpdater with MySql</title>
		<link>http://www.tewari.info/2009/09/28/using-dbupdater-with-mysql/</link>
		<comments>http://www.tewari.info/2009/09/28/using-dbupdater-with-mysql/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 07:13:02 +0000</pubDate>
		<dc:creator>tewari</dc:creator>
				<category><![CDATA[database]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[DbUpdater]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[NHibernate]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://www.tewari.info/?p=129</guid>
		<description><![CDATA[DbUpdater can be used with mysql.

Here are the files you need to jumpstart the integration &#8211; DbUpdater-MySql.zip

1. You might need to change the path to mysql.exe in mysql-exec.bat.

2. Modify values in mysql-sample-command-line.bat.

Make sure mysql.data.dll is placed in GAC or in the same directory as DbUpdater.exe. Connector binaries can be downloaded from here -
http://dev.mysql.com/downloads/connector/net/6.1.htmlCopyright &#169; 2010 [...]]]></description>
			<content:encoded><![CDATA[<a title="DbUpdater Page" href="http://www.tewari.info/dbupdater/">DbUpdater</a> can be used with <a title="mysql.com" href="http://www.mysql.com/">mysql</a>.

Here are the files you need to jumpstart the integration &#8211; <a title="DbUpdater-MySql.zip" href="http://www.tewari.info/downloads/DbUpdater-MySql.zip">DbUpdater-MySql.zip</a>

1. You might need to change the path to mysql.exe in mysql-exec.bat.

2. Modify values in mysql-sample-command-line.bat.

Make sure mysql.data.dll is placed in GAC or in the same directory as DbUpdater.exe. Connector binaries can be downloaded from here -
<a title="MySql .NET Connector Download" href="http://dev.mysql.com/downloads/connector/net/6.1.html">http://dev.mysql.com/downloads/connector/net/6.1.html</a><hr/>Copyright &copy; 2010 <strong><a href="http://www.tewari.info">tewari</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@tewari.info so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span><p class="akst_link"><a href="http://www.tewari.info/?p=129&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_129" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.tewari.info/2009/09/28/using-dbupdater-with-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Azure Notes</title>
		<link>http://www.tewari.info/2009/09/10/sql-azure-notes/</link>
		<comments>http://www.tewari.info/2009/09/10/sql-azure-notes/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 03:45:26 +0000</pubDate>
		<dc:creator>tewari</dc:creator>
				<category><![CDATA[sql]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[DbUpdater]]></category>
		<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[sql server 2008]]></category>
		<category><![CDATA[t-sql]]></category>

		<guid isPermaLink="false">http://www.tewari.info/?p=102</guid>
		<description><![CDATA[	My invitation code for SQL Azure CTP finally arrived. I had been waiting for this.
	
	You can create a database in from the SQL Azure Management page, shown above.
	After you have created the database, of course, you can use DbUpdater with your SQL Azure databases. Here is the command-line :
DbUpdater.exe ..\SqlScripts /server:&#8221;tcp:SERVER.ctp.database.windows.net&#8221; /db:DATABASE /user:&#8221;USER@SERVER&#8221; /password:PASSWORD /confirm:true
	And you [...]]]></description>
			<content:encoded><![CDATA[	<p>My invitation code for <a href="http://www.microsoft.com/azure/sql.mspx">SQL Azure CTP</a> finally arrived. I had been waiting for this.</p>
	<p><img src="http://www.tewari.info/images/sqlazure-manage.png" alt="sqlazure-manage.png" width="737" height="591" /></p>
	<p>You can create a database in from the SQL Azure Management page, shown above.</p>
	<p>After you have created the database, of course, you can use <a href="../dbupdater/">DbUpdater</a> with your SQL Azure databases. Here is the command-line :<br />
DbUpdater.exe ..\SqlScripts /server:&#8221;tcp:SERVER.ctp.database.windows.net&#8221; /db:DATABASE /user:&#8221;USER@SERVER&#8221; /password:PASSWORD /confirm:true</p>
	<p>And you will need this DbUpdater.exe.config file :</p>
	<p>&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243; ?&gt;<br />
&lt;configuration&gt;<br />
&lt;appSettings&gt;<br />
&lt;add key=&#8221;file-prefix&#8221; value=&#8221;db&#8221; /&gt;<br />
&lt;add key=&#8221;file-extension&#8221; value=&#8221;sql&#8221; /&gt;<br />
&lt;add key=&#8221;schema-versions-name&#8221; value=&#8221;schema-versions-table.sql&#8221; /&gt;<br />
&lt;add key=&#8221;baseline-name&#8221; value=&#8221;baseline.sql&#8221; /&gt;<br />
&lt;add key=&#8221;post-script-prefix&#8221; value=&#8221;post&#8221; /&gt;<br />
&lt;add key=&#8221;post-script-always-apply&#8221; value=&#8221;true&#8221; /&gt;<br />
&lt;add key=&#8221;exe-file&#8221; value=&#8221;C:\Program Files\Microsoft SQL Server\90\Tools\Binn\SQLCMD.EXE&#8221; /&gt;<br />
&lt;add key=&#8221;exe-args&#8221; value=&#8217;-U %UserName% -P %Password% -S &#8220;%ServerName%&#8221; -d %DbName% -i &#8220;%SqlFile%&#8221;&#8216; /&gt;<br />
&lt;add key=&#8221;dialect&#8221; value=&#8221;NHibernate.Dialect.MsSql2000Dialect&#8221; /&gt;<br />
&lt;add key=&#8221;driver_class&#8221; value=&#8221;NHibernate.Driver.SqlClientDriver&#8221; /&gt;<br />
&lt;add key=&#8221;connection_string&#8221; value=&#8221;Server=%ServerName%;Database=%DbName%;User ID=%UserName%;Password=%Password%;Trusted_Connection=False;&#8221; /&gt;<br />
&lt;/appSettings&gt;<br />
&lt;/configuration&gt;</p>
	<p>You can run sqlcmd.exe directly to execute t-sql scripts on SQL Azure. Here is a sample command :<br />
sqlcmd.exe -S SERVER.ctp.database.windows.net -U USER@SERVER -P PASSWORD -d DB -i &#8220;baseline.sql&#8221;</p>
	<p>I received these errors when I executed my SQL Server 2005 scripts on a SQL Azure database -</p>
	<ul>
	<li>&#8216;ANSI_NULLS&#8217; is not a recognized SET option.</li>
	<li> Deprecated feature &#8216;SET ANSI_PADDING OFF&#8217; is not supported in this version of SQL Server.</li>
	<li> Deprecated feature &#8216;More than two-part column name&#8217; is not supported in this version of SQL Server.</li>
	<li> Deprecated feature &#8216;Data types: text ntext or image&#8217; is not supported in this version of SQL Server.</li>
	<li>Deprecated feature &#8216;Table hint without WITH&#8217; is not supported in this version of SQL Server.</li>
	</ul>
	<p>These are not the limitations of the SQL Azure platform. SQL Azure is based on SQL Server 2008 Database Engine. The complete list of deprecated features in SQL Server 2008 are listed here along with the replacements (if any) : <a href="http://msdn.microsoft.com/en-us/library/ms143729.aspx">Deprecated Database Engine Features in SQL Server 2008 &#8211; MSDN.</a><br />
After modifying the scripts to replace the deprecated features, the scripts could be executed without any further issues. All stored procedures, triggers and views were created without any errors.</p>
	<p>The following error <span style="text-decoration: underline;">is</span> a SQL Azure limitation.</p>
	<ul>
	<li> &#8216;Filegroup reference and partitioning scheme&#8217; is not supported in this version of SQL Server.</li>
	</ul>
	<p>Here is more detailed information on unsupported T-SQL &#8211; <a href="http://msdn.microsoft.com/en-us/library/ee336253.aspx">Unsupported Transact-SQL Statements (SQL Azure Database)           &#8211; MSDN</a><hr/>Copyright &copy; 2010 <strong><a href="http://www.tewari.info">tewari</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@tewari.info so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>
</p>
<p class="akst_link"><a href="http://www.tewari.info/?p=102&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_102" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.tewari.info/2009/09/10/sql-azure-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using NHibernate With SQLite in DbUpdater</title>
		<link>http://www.tewari.info/2008/09/09/using-nhibernate-with-sqlite-in-dbupdater/</link>
		<comments>http://www.tewari.info/2008/09/09/using-nhibernate-with-sqlite-in-dbupdater/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 04:46:39 +0000</pubDate>
		<dc:creator>tewari</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[DbUpdater]]></category>
		<category><![CDATA[sqlite NHibernate]]></category>

		<guid isPermaLink="false">http://www.tewari.info/2008/09/09/using-nhibernate-with-sqlite-in-dbupdater/</guid>
		<description><![CDATA[	DbUpdater (version 1.3 onwards) can be used with sqlite3.
	Review the files included in DbUpdater-sqlite3.zip
	1. DbUpdater.exe.config must be modified. Note changes to the following keys &#8211; exe-file, exe-args, dialect, driver_class, connetion_string.
2. SchemaVersion.hbm.xml must be modified. The &#8216;class&#8217; attributes value for the &#8216;generator&#8217; of &#8216;id&#8217; must be changed to &#8216;identity&#8217;. No other changes are needed here.
3. \SqlScripts\schema-version-table.sql [...]]]></description>
			<content:encoded><![CDATA[	<p><a href="http://www.tewari.info/dbupdater/">DbUpdater</a> (<a href="http://sourceforge.net/projects/dbupdater/">version 1.3</a> onwards) can be used with <a href="http://www.sqlite.org/">sqlite3</a>.</p>
	<p>Review the files included in<a href="http://www.tewari.info/downloads/DbUpdater-sqlite3.zip"> DbUpdater-sqlite3.zip</a></p>
	<p>1. DbUpdater.exe.config must be modified. Note changes to the following keys &#8211; exe-file, exe-args, dialect, driver_class, connetion_string.<br />
2. SchemaVersion.hbm.xml must be modified. The &#8216;class&#8217; attributes value for the &#8216;generator&#8217; of &#8216;id&#8217; must be changed to &#8216;identity&#8217;. No other changes are needed here.<br />
3. \SqlScripts\schema-version-table.sql is modified. Note that the datatypes of all columns are changed to TEXT, except for SchemaChangeId, which is changed to integer primary key. integer primary key is used for auto-incremented columns in sqlite.<br />
4. \SqlScripts\baseline.sql is modified. Note the use of current_timestamp function. The actual sql syntax in this file must conform to sqlite dialect.<br />
5. All other .sql scripts in \SqlScripts directory are also modified to conform to sqlite dialect.</p>
	<p>The following files are expected to be in DbUpdater.exe directory (as configured in the DbUpdater.exe.config file) -</p>
	<p>1. sqlite3.exe : <a href="http://www.sqlite.org/download.html">download</a>.<br />
2. System.Data.SQLite.dll : <a href="http://sqlite.phxsoftware.com/">download</a>.<br />
3. createdb.bat file : This file is included. This batch script will call sqlite3.exe to execute sql queries.</p>
	<p>Another very useful tool for working with sqlite database files is <a href="http://sqlitebrowser.sourceforge.net/">SQLite Database Browzer</a>.<a href="http://www.tewari.info/wp-content/sqlite-support.html" title="sqlite-support.html"> </a><hr/>Copyright &copy; 2010 <strong><a href="http://www.tewari.info">tewari</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@tewari.info so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>
</p>
<p class="akst_link"><a href="http://www.tewari.info/?p=41&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_41" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.tewari.info/2008/09/09/using-nhibernate-with-sqlite-in-dbupdater/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>WPF &#8211; LINQ to SQL Sample</title>
		<link>http://www.tewari.info/2008/03/07/wpf-linq-to-sql-sample/</link>
		<comments>http://www.tewari.info/2008/03/07/wpf-linq-to-sql-sample/#comments</comments>
		<pubDate>Fri, 07 Mar 2008 07:15:35 +0000</pubDate>
		<dc:creator>tewari</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[AdventureWorks]]></category>
		<category><![CDATA[control]]></category>
		<category><![CDATA[DataBinding]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[ListView]]></category>
		<category><![CDATA[mapping]]></category>
		<category><![CDATA[sample]]></category>
		<category><![CDATA[Share]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[WPF-LINQ]]></category>

		<guid isPermaLink="false">http://www.tewari.info/2008/03/07/wpf-linq-to-sql-sample/</guid>
		<description><![CDATA[	This exercise in binding a WPF ListView control with LINQ to SQL was a lot of fun ! The following image shows data from AdventureWorks sample database displayed in the ListView control. The end result is very admirable, even in this very basic demo. Feeling a complete sense of freedom is unavoidable when working with [...]]]></description>
			<content:encoded><![CDATA[	<p>This exercise in binding a WPF ListView control with LINQ to SQL was a lot of fun ! The following image shows data from <a href="http://www.codeplex.com/MSFTDBProdSamples" title="MSSQL Sample Databases" target="_blank">AdventureWorks </a>sample database displayed in the ListView control. The end result is very admirable, even in this very basic demo. Feeling a complete sense of freedom is unavoidable when working with WPF.</p>
	<p><img src="http://www.tewari.info/images/Linq2SqlSample1.Png" alt="Linq2SqlSample1.Png" height="390" width="555" /></p>
	<p>This sample demonstrates :</p>
	<ol>
	<li>LINQ to SQL mapping.</li>
	<li>WPF ListView Control DataBinding.</li>
	<li>Displaying images stored in database as varbinary in WPF control.</li>
	</ol>
	<p>The sample code can be downloaded here : <a href="http://www.tewari.info/downloads/Linq2SqlSample.zip" title="Linq2SqlSample.zip" target="_blank">WPF-LINQ to SQL Sample</a><br />
License : <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/us/" rel="license">Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.</a></p>
	<p><a href="http://creativecommons.org/licenses/by-nc-sa/3.0/us/" rel="license"><img src="http://i.creativecommons.org/l/by-nc-sa/3.0/us/88x31.png" alt="Creative Commons License" style="border-width: 0pt" /></a><hr/>Copyright &copy; 2010 <strong><a href="http://www.tewari.info">tewari</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@tewari.info so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>
</p>
<p class="akst_link"><a href="http://www.tewari.info/?p=33&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_33" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.tewari.info/2008/03/07/wpf-linq-to-sql-sample/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Database Schema Version Control Tool</title>
		<link>http://www.tewari.info/2008/02/18/dbupdater-database-schema-version-control/</link>
		<comments>http://www.tewari.info/2008/02/18/dbupdater-database-schema-version-control/#comments</comments>
		<pubDate>Tue, 19 Feb 2008 03:05:52 +0000</pubDate>
		<dc:creator>tewari</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[freeware]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[version-control]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[change]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[database schema]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[DBMS]]></category>
		<category><![CDATA[DbUpdater]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[Evolutionary]]></category>
		<category><![CDATA[free tool]]></category>
		<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[NHibernate]]></category>
		<category><![CDATA[process]]></category>
		<category><![CDATA[schema]]></category>
		<category><![CDATA[schema version]]></category>
		<category><![CDATA[SchemaVersionsLog]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[sql scripts]]></category>
		<category><![CDATA[table]]></category>
		<category><![CDATA[tool]]></category>
		<category><![CDATA[version]]></category>
		<category><![CDATA[version control tool]]></category>
		<category><![CDATA[Versioning]]></category>

		<guid isPermaLink="false">http://www.tewari.info/2008/02/18/dbupdater-database-schema-version-control/</guid>
		<description><![CDATA[	It is essential to treat database schema as source code  and apply all the norms and best practices applicable to it. From what I hear  and read, database schema version control is non-existent in too many  projects.
	Various techniques to accomplish version control of  database schemas have been discussed and published. Martin [...]]]></description>
			<content:encoded><![CDATA[	<p designtimesp="18554">It is essential to treat database schema as source code  and apply all the norms and best practices applicable to it. From what I hear  and read, database schema version control is non-existent in too many  projects.</p>
	<p designtimesp="18555">Various techniques to accomplish version control of  database schemas have been discussed and published. Martin Fowler and Pramod  Sadagale has written a comprehensive article on <a href="http://martinfowler.com/articles/evodb.html" designtimesp="18556">Evolutionary Database  Design</a>. It is a must-read for everyone involved with database  development.</p>
	<p designtimesp="18562">K. Scott Allen writes in detail about an  excellent system here &#8211; <a href="http://odetocode.com/Blogs/scott/archive/2008/02/02/11721.aspx" title="Versioning Databases - Change Scripts" designtimesp="18561">Versioning Databases &#8211; Change Scripts</a>. This approach  is sufficiently light-weight (for my taste) and provides complete control over  the whole process.</p>
	<p designtimesp="18562">I am providing a free tool here that you can use to  implement this system. It will even create the SchemaVersionsLog table for your  database, if it doesn&#8217;t exist. If you are using this tool with MSSQL Server, you  can get started with very little effort. If you are using a different DBMS, you  can still use this tool. It uses NHibernate to access the SchemaVersionsLog  table. So, any DBMS supported by NHibernate is acceptable, as long as it comes with a command line tool to execute the sql scripts.</p>
	<p designtimesp="18562">Download <a href="http://www.tewari.info/dbupdater/" title="DbUpdater : Database Schema Version Control" target="_blank">DbUpdater here</a>.</p>
<hr/>Copyright &copy; 2010 <strong><a href="http://www.tewari.info">tewari</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@tewari.info so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>
</p>
<p class="akst_link"><a href="http://www.tewari.info/?p=17&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_17" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.tewari.info/2008/02/18/dbupdater-database-schema-version-control/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
