关于程序返回值 [英] regarding procedure return value
本文介绍了关于程序返回值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将如何在过程中返回集合或任何对象或多列.有什么办法吗?
假设我有80个列值要由某个过程返回...比我将如何?
how would i return a collection or any object or multiple columns in procedure. Is there any way of doing this.
suppose i have 80 columns value to return by a procedure... than how would i be ?
推荐答案
类似这样的东西:
Something like this:
USE MyDataBase;
GO
CREATE PROCEDURE dbo.MyStoredProc
AS
SELECT ColumnA, ColumnB, ColumnC, ColumnD..., ColumnZ FROM MyTable
GO
还是我缺少什么?
OR am I missing something?
简单的创建存储过程并编写您的选择查询.它会给您您想要的结果.
simple create store procedure and write your select query. it will give you your desired result.
create proc UrProcedureName
@Param DataType=null
as
begin
select * from UrTableName where urCondition
end
这篇关于关于程序返回值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文