SQL NET - A Place to talk on MS SQL Server and other database tools

Talks on SQL Server, database development, data management techniques,SQLBI/SSIS/SSAS/SSRS etc. Want to publish something db related ? mail to bineeshthomas@gmail.com with subject line starting as "SQLNET"

SQL NET FORUM

Portal Maintained By : BINEESH THOMAS

Tuesday, November 07, 2006

Joining SP output with a table

--Set the data access option for the server

EXEC sp_serveroption 'MYSERVER', 'data access', true

--GO

USE pubs

go

CREATE TABLE #table1( i int identity)

INSERT #table1 DEFAULT VALUES

INSERT #table1 DEFAULT VALUES

go

CREATE PROC spProc1

as

SELECT 1 AS id

go

SELECT *

FROM #table1 t1 inner JOIN openquery([MYSERVER], '{call pubs..spProc1}') t2

ON t1.i = t2.id


0 Comments:

Post a Comment

<< Home

Free Domain Name - www.YOU.co.nr!