OPENQUERY can be used to execute extended stored procedures on a linked server

  • 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)

Viewing 0 posts

You must be logged in to reply to this topic. Login to reply