Sql server 如何在SQLServerManagementStudio中创建存储过程

Sql server 如何在SQLServerManagementStudio中创建存储过程,sql-server,entity-framework,stored-procedures,Sql Server,Entity Framework,Stored Procedures,我在SQL Server中有一个表,我想创建一个存储过程来插入表的数据(UserInformation) 我是新手,请告诉我如何创建存储过程。创建存储过程 Create procedure MyProcedure (@id varchar(20),@search varchar(20) ) -- these are the parameters to this procedure as begin select * from yourTable where ID=@id en

我在SQL Server中有一个表,我想创建一个存储过程来插入表的数据(
UserInformation


我是新手,请告诉我如何创建存储过程。

创建存储过程

Create procedure  MyProcedure 
(@id  varchar(20),@search varchar(20) ) -- these are the parameters to this procedure
as

begin

    select * from yourTable where ID=@id

end
或(无参数)

使用实体框架调用存储过程

// tbl_CompMgmt is a class which look exctly like the result returned 
var mgtList = db.ExecuteStoreQuery<tbl_CompMgmt>("exec GetSortedManagement @Companay_ID=" + compID).ToList();
//tbl_CompMgmt是一个看起来非常像返回结果的类
var mgtList=db.ExecuteStoreQuery(“exec GetSortedManagement@company_ID=“+compID).ToList();

打开您最喜欢的浏览器并搜索感谢您提供的信息,请帮助我如何通过asp.net调用存储过程,我已经创建了一个select存储过程,现在如何调用请参考此页面,如果您有问题,请在此处发布
// tbl_CompMgmt is a class which look exctly like the result returned 
var mgtList = db.ExecuteStoreQuery<tbl_CompMgmt>("exec GetSortedManagement @Companay_ID=" + compID).ToList();