我有一个存储过程,它采用int作为参数。我使用实体框架代码首先随着MVC和我正在以这种方式调用将参数传递给存储过程实体框架与SQL Server 2005
SqlParameter sa = new SqlParameter("@userId", userId);
var query = from dashboardData in TBSCIDBContext.Database.SqlQuery<MyNomination>("sp_GetMyNominationList @userId", sa)
select dashboardData;
return query.ToList();
在探查我得到
exec sp_executesql N'sp_GetMyNominationList @userId',N'@userId int',@userId=4
这正确执行上使用SQL Server 2008,但现在我的数据库是更改为2005 和相同的执行语句给我
“sp_GetMyNominationList”附近的语法不正确。因为我在2005年
运行它,我不得不使用2005,请告诉我一个方法,使2005年此运行,使得参数由SQL事件探查器