title: passing parameters to stored procedure entity framework with sql server 2005
body: <p>I have a stored proc which takes a int as parameter.  I am using entity framework code first along with MVC and I am making the call in this manner</p>
  
  <pre><code>        SqlParameter sa = new SqlParameter("@userId", userId);
          var query = from dashboardData in TBSCIDBContext.Database.SqlQuery&lt;MyNomination&gt;("sp_GetMyNominationList @userId", sa)
                      select dashboardData;
          return query.ToList();
  </code></pre>
  
  <p>in profiler I get</p>
  
  <pre><code>exec sp_executesql N'sp_GetMyNominationList @userId',N'@userId int',@userId=4  
  </code></pre>
  
  <p>This executes correctly on using sql server 2008 but now my db is changed to 2005
  and the same exec statement gives me</p>
  
  <p>Incorrect syntax near 'sp_GetMyNominationList'. because I am running it in 2005. </p>
  
  <p>I have to use 2005 please tell me a way to make this run in 2005 so that the parameter is taken correctly by the sql profiler</p>