且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在SQL SERVER中编写存储过程?

更新时间:2023-02-07 11:20:50

除了上述解决方案之外,这里还有一个简单的解决方案


创建过程ProcedureName
(
@Id //Based on which you want to filter your details
)

SELECT FirstName,LastName,JobTitle,部门 // Your columns Name which you want to return

FROM HumanResources // Your Table Name

DeptId = @Id //Where Condition to filter your Result
In addition to the Above Solution here is one simple solution


create Procedure ProcedureName
(
@Id //Based on which you want to filter your details
)
as
SELECT FirstName, LastName, JobTitle, Department // Your columns Name which you want to return

FROM HumanResources // Your Table Name

WHERE DeptId = @Id //Where Condition to filter your Result


在Internet上进行搜索,并通过一些教程编写存储过程.
试用msdn网站.

您可能还希望获取一些有关存储过程的基础书籍并仔细阅读.
Do a search on the internet and go through some tutorials on writing stored procedures.
Try out the msdn website.

You might also want to pick up some basic books on stored procedures and go through them.


您需要学习如何创建存储过程,看看给定的链接
如何:创建存储过程 [ ^ ]
如何编写存储过程 [面向初学者的SQL Server存储过程 [
You need to learn how to create Stored Procedure Take a look at given links
How to: Create a Stored Procedure[^]
How to Write Store Procedure[^] and
SQL Server Stored Procedures for Beginners[^]