如何通过Store Procdure在select语句中显示两个结果 [英] How Can display tow result in select statement By Store Procdure

查看:48
本文介绍了如何通过Store Procdure在select语句中显示两个结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在选择语句中显示拖拽结果按商店流程:





How Can display tow result in select statement By Store Procdure :


ALTER proc  [dbo].[PrinttProducts_TBL] 
@Product_id int
 
as
select pt.Product_id ,pt.Product_name ,pt.Product_Price  
from dbo.Products_TBL pt
 inner join  tblcatProducts cp on cp.catId = pt.FK_catId inner join  StoresTBL st on pt.FK_Store_id = st.Store_id 
where Product_id=@Product_id and 

select DATEADD(year, 1, '2006-08-30') as 'Datenew'

推荐答案

如果删除之间这两个查询,它将返回两个结果集。如何显示它们取决于您使用什么来执行该过程(ADO.NET,实体框架,管理工作室等)。



If you remove the and between the two queries, it will return two result sets. The how to display them will depend on what you are using to execute the procedure (ADO.NET, Entity Framework, Management Studio, etc.).

ALTER proc [dbo].[PrinttProducts_TBL]
@Product_id int

as
select pt.Product_id ,pt.Product_name ,pt.Product_Price
from dbo.Products_TBL pt
inner join tblcatProducts cp on cp.catId = pt.FK_catId inner join StoresTBL st on pt.FK_Store_id = st.Store_id
where Product_id=@Product_id

select DATEADD(year, 1, '2006-08-30') as Datenew


这篇关于如何通过Store Procdure在select语句中显示两个结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆