<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.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>Search results for 'app:weblogs' matching tags 'DDD' and 'Entity framework'</title><link>http://msmvps.com/search/SearchResults.aspx?q=app:weblogs&amp;tag=DDD,Entity+framework&amp;orTags=0&amp;o=DateDescending</link><description>Search results for 'app:weblogs' matching tags 'DDD' and 'Entity framework'</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>DDD 8 Entity framework follow up - Will cast(column as int) allow use of an index</title><link>/http://feedproxy.google.com/~r/SimonsSqlServerStuff/~3/WLRFc7s2mRc/DDD-8-Entity-framework-follow-up---Will-cast-column-as-int--allow-use-of-an-index.aspx</link><pubDate>Sun, 31 Jan 2010 06:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1754616</guid><dc:creator>Anonymous</dc:creator><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;I pointed out yesterday that the EntityFramework doesn&amp;#39;t 
like smallints. Well it does and it doesn&amp;#39;t The model handles them fine and the 
objects have datatypes of int16 which is great.&lt;/p&gt;
&lt;p&gt;However the queries that are generated do this odd thing with any predicates 
on such columns. It applies a cast to column.i.e&lt;/p&gt;
&lt;p style="MARGIN:0cm 0cm 10pt;" class="MsoNormal"&gt;&lt;span style="LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;COLOR:blue;FONT-SIZE:14pt;mso-no-proof:yes;"&gt;where&lt;/span&gt;&lt;span style="LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;FONT-SIZE:14pt;mso-no-proof:yes;"&gt; 
&lt;span style="COLOR:fuchsia;"&gt;cast&lt;/span&gt;&lt;span style="COLOR:gray;"&gt;(&lt;/span&gt;col2 
&lt;span style="COLOR:blue;"&gt;as&lt;/span&gt; &lt;span style="COLOR:blue;"&gt;int&lt;/span&gt;&lt;span style="COLOR:gray;"&gt;)=&lt;/span&gt; @d&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;At first glance I thought oh now not another screw up with the SQL from 
Entity framework, but on inspection of a query plan where the column in question 
was indexed I still got a seek operation. Very nice, well done optimisation 
team.&lt;/p&gt;
&lt;p&gt;When I pointed this out, I was asked whether this worked on SQL2005. Having 
only got a SQL2008 instance on my laptop I took the question away for testing. 
The reason of the question could be related to the fact that in SQL 2008 the 
introduced the ability to cast a datetime to a date to be able to look for 
specific days of data and still use an index.&lt;/p&gt;
&lt;p&gt;I have now tested and can state that it does work on SQL 
2005.&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=12958" width="1" height="1" alt="" /&gt;&lt;img src="http://feeds.feedburner.com/~r/SimonsSqlServerStuff/~4/WLRFc7s2mRc" height="1" width="1" alt="" /&gt;</description></item><item><title>Entity Framework how to stop your DBA having a heart attack</title><link>/http://feedproxy.google.com/~r/SimonsSqlServerStuff/~3/XZRS926RSQk/Entity-Framework-how-to-stop-your-DBA-having-a-heart-attack.aspx</link><pubDate>Sat, 30 Jan 2010 06:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1754492</guid><dc:creator>Anonymous</dc:creator><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;My code and presentation from my session at Developer 
Day 8 are now available here&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.sqlknowhow.com/presentations/ddd_8/DDD_8-Entity_Framework.zip"&gt; DDD_8-Entity_Framework Code&lt;/a&gt; &lt;br /&gt;
&lt;a href="http://www.sqlknowhow.com/presentations/ddd_8/Entity_Framework.pptx"&gt;Entity framework presentation &lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;Any questions let me know&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=12954" width="1" height="1" alt="" /&gt;&lt;img src="http://feeds.feedburner.com/~r/SimonsSqlServerStuff/~4/XZRS926RSQk" height="1" width="1" alt="" /&gt;</description></item></channel></rss>