Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

OPENQUERY can be used to execute extended stored procedures on a linked server Expand / Collapse
Author
Message
Posted Friday, October 22, 2010 9:06 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, March 5, 2012 10:56 AM
Points: 1, Visits: 20
Hi there.
I was trying to run and extended stored procedures with open query i tried the following and i was successful.

SELECT [date],Price_List,InvestmentCode,Denomination,price FROM OPENQUERY(Linked_Server,'SET FMTONLY OFF Exec master.dbo.CallSql ''SELECT Date, Price_List, InvestmentCode, Den, Price FROM priPricing WHERE Date == "10/21/2010"''')
---*******************
Declare @PreviousDayDate varchar(40)
select @PreviousDayDate = QueryDate from #tmp2
set @sql ='insert into #tmp1([Date] ,Price_List , InvestmentCode , Denomination ,Price)
SELECT [date],Price_List,InvestmentCode,Denomination,price FROM OPENQUERYLinked_Server,''SET FMTONLY OFF Exec master.dbo.CallGenevaSql ''''SELECT Date, Price_List, InvestmentCode, Denomination, Price FROM priPricing Date == "' + @PreviousDayDate + '"'''''')'
EXEC(@sql)
--print(@sql)
Post #1009276
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse