Posts

Showing posts from March, 2016

Executing a Stored Procedure....The Proper Way

As we develop in Microsoft's Entity Framework family, we will at times run into a situation, or by design, the need to execute a Stored Procedure from the database (most likely Microsoft SQL Server ).  As we have discovered, they (Microsoft) evidently do not want us to do this inherently.  They hid the direct SProc execution well down into the Database object (off the DbContext object ) and even then it has a few names: SqlQuery and ExecuteSqlCommand .  Of course, both of these have their equivalent ASync execution versions. To make matters even more fun and interesting, is the problem of Ordinal execution.  Any proper DBA will tell you, if asked, that Ordinal execution is a bad implementation pattern.  And you developers, will simply respond: Well then don't change the order in which the Parameters exist.  Then the DBA responds, and the banter battle begins between a Developer and a DBA. My simple solution to avoid this whole needless verbal battle and disagreement is