Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)

  • RE: OPENQUERY - Is there any way to...

    Heres the stored proc I created to do generic dynamic openquery selects...

    CREATE PROCEDURE [dbo].[LinkedServerQuery]

    (

    @LinkedServerName varchar(50),

    @SQL varchar(max)

    )

    AS

    BEGIN

    DECLARE @LinkedSQL varchar(max)

    SET @LinkedSQL = 'SELECT * FROM OPENQUERY(' + @LinkedServerName + ','''+ REPLACE(@SQL, '@',...

  • RE: update openquery remote tabel with join

    What happens if you add to the end...

    where products_id = a.products_id

  • RE: OPENQUERY - Is there any way to...

    Nice one. That approach worked well against my linked server. I'll create a function to do the same but will probably escape out those single quotes with another character. They...

  • RE: OPENQUERY - Is there any way to...

    If that works, thats even simpler than my solution. I'm sure I tried similar before I went down the extended stored proc route but failed miserably. Will give it a...

  • RE: OPENQUERY - Is there any way to...

    A late reply but I have done this recently. The problem is that you can only use static strings in openquery, not one that has been dynamically built up.

    I got...

Viewing 5 posts - 1 through 5 (of 5 total)