存储过程中的行集作为子查询

  存储过程中的行集作为子查询
可以使用Openrowset,但Openrowset不支持参数话的语句,要实现参数只能在客户端程序中把要的最终语句拼接好传入。
实际应用中,我用openrowset连接ssas服务器来和sqlserver数据库对象实现交互。
测试语句如下:

 

use tempdb
go
create proc p_test
as
begin
    select 1 as a,2 as b,3 as c union
    select 4 as a,5 as b,6 as c union
    select 7 as a,8 as b,9 as c
end
go
select * from openrowset
('sqlOLEDB','Server=.;Trusted_Connection=yes;DataBase=tempdb',
'exec p_test' )  where a <> 4
go
drop proc p_test

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/jinjazz/archive/2009/08/27/4489870.aspx

相关文章

SELECT a.*,b.dp_name,c.pa_name,fm_name=(CASE WHEN a.fm_n...
if not exists(select name from syscolumns where name=&am...
select a.*,pano=a.pa_no,b.pa_name,f.dp_name,e.fw_state_n...
要在 SQL Server 2019 中设置定时自动重启,可以使用 Window...
您收到的错误消息表明数据库 &#39;EastRiver&#39; 的...
首先我需要查询出需要使用SQL Server Profiler跟踪的数据库标...