<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Assigning MSBuild Properties to SQLCMD Variables</title><link>http://blogs.msdn.com/gertd/archive/2009/06/21/assigning-msbuild-properties-to-sqlcmd-variables.aspx</link><description>I am receiving the following question a lot: How do I propagate MSBuild properties to SQLCMD variables. In order to make the Visual Studio 2008 Team System Database Edition GDR release use the data from an MSBuild property inside a SQLCMD variable you</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Tune Up Your PC  &amp;raquo; Post Topic   &amp;raquo; Assigning MSBuild Properties to SQLCMD Variables</title><link>http://blogs.msdn.com/gertd/archive/2009/06/21/assigning-msbuild-properties-to-sqlcmd-variables.aspx#9796822</link><pubDate>Mon, 22 Jun 2009 05:54:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9796822</guid><dc:creator>Tune Up Your PC  &amp;raquo; Post Topic   &amp;raquo; Assigning MSBuild Properties to SQLCMD Variables</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://tune-up-pc.com/blog/?p=2555"&gt;http://tune-up-pc.com/blog/?p=2555&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Assigning MSBuild Properties to SQLCMD Variables</title><link>http://blogs.msdn.com/gertd/archive/2009/06/21/assigning-msbuild-properties-to-sqlcmd-variables.aspx#9929430</link><pubDate>Fri, 27 Nov 2009 15:52:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9929430</guid><dc:creator>Brandon</dc:creator><description>&lt;p&gt;I am getting the error:&lt;/p&gt;
&lt;p&gt;the element itemgroup in namespace has invalid child element sqlcommand variable override&lt;/p&gt;
&lt;p&gt;and the variable is not being passed.&lt;/p&gt;
&lt;p&gt;This is what I have.&lt;/p&gt;
&lt;p&gt;&amp;lt;ItemGroup&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;lt;SqlCommandVariableOverride Include=&amp;quot;AssemblyVersionNumber=$(BuildNumber)&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;/ItemGroup&amp;gt;&lt;/p&gt;
&lt;p&gt;There is a blue squiggly under SqlCommandVariableOverride&lt;/p&gt;</description></item><item><title>re: Assigning MSBuild Properties to SQLCMD Variables</title><link>http://blogs.msdn.com/gertd/archive/2009/06/21/assigning-msbuild-properties-to-sqlcmd-variables.aspx#9929489</link><pubDate>Fri, 27 Nov 2009 19:23:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9929489</guid><dc:creator>gertd</dc:creator><description>&lt;p&gt;Q: I am getting the error: the element itemgroup in namespace has invalid child element sqlcommand variable override&lt;/p&gt;
&lt;p&gt;A: The red squiggly is expect, since the schema for the XLM (&lt;a rel="nofollow" target="_new" href="http://schemas.microsoft.com/developer/msbuild/2003"&gt;http://schemas.microsoft.com/developer/msbuild/2003&lt;/a&gt;) does not include the definitions, which is not a problem&lt;/p&gt;
&lt;p&gt;You will see multiple warnings when opening the XML of the project file in the error list like this:&lt;/p&gt;
&lt;p&gt;The element 'ItemGroup' in namespace '&lt;a rel="nofollow" target="_new" href="http://schemas.microsoft.com/developer/msbuild/2003"&gt;http://schemas.microsoft.com/developer/msbuild/2003&lt;/a&gt;' has invalid child element 'SqlCommandVariableOverride' in namespace '&lt;a rel="nofollow" target="_new" href="http://schemas.microsoft.com/developer/msbuild/2003"&gt;http://schemas.microsoft.com/developer/msbuild/2003&lt;/a&gt;'. List of possible elements expected: 'Item' in namespace '&lt;a rel="nofollow" target="_new" href="http://schemas.microsoft.com/developer/msbuild/2003"&gt;http://schemas.microsoft.com/developer/msbuild/2003&lt;/a&gt;'.&lt;/p&gt;
&lt;p&gt;Q: variable is not being passed&lt;/p&gt;
&lt;p&gt;A: Did you define the BuildNumber property? &lt;/p&gt;
&lt;p&gt;I created a sample project, available at:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://cid-526eb9977609d51e.skydrive.live.com/self.aspx/DataDude/Test/SqlCmdMSBuild/SqlCmdMSBuild.zip"&gt;http://cid-526eb9977609d51e.skydrive.live.com/self.aspx/DataDude/Test/SqlCmdMSBuild/SqlCmdMSBuild.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;which outputs:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Creating SqlCmdMSBuild...&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;SQLCMD ProjectDirectory = d:\demo\SqlCmdMSBuild&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;SQLCMD AssemblyVersionNumber = 1.0.0.0&lt;/p&gt;
&lt;p&gt;But you have to define the property BuildNumber like this:&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;PropertyGroup&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;lt;BuildNumber&amp;gt;1.0.0.0&amp;lt;/BuildNumber&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;&amp;lt;/PropertyGroup&amp;gt;&lt;/p&gt;
</description></item></channel></rss>