Help please on OpenRowSet

  • Hi All,

    I have this query below:

    Set @TableNameSQL ='Select Count(*) from' + @TableNameVar

    INSERT INTO @tempTable (DevServer)

    SELECT a.*

    FROM OPENROWSET('SQLOLEDB',

    'Server';'uname';'password',

    ' + @TableNameSQL + ' ) AS a

    I need to pass the Query on the openrowset is this possible or how do I do it.

    Please help.

    Thanks in advance.

  • This was removed by the editor as SPAM

  • you have to enable Ad Hoc Distributed Queries by running the below query

    sp_configure 'show advanced options', 1;

    GO

    RECONFIGURE;

    GO

    sp_configure 'Ad Hoc Distributed Queries', 1;

    GO

    RECONFIGURE

    GO

    [font="Arial Black"]Performance Guard[/font]

    [font="Courier New"]Just ask me to get 0 sec for all queries[/font]

Viewing 3 posts - 1 through 2 (of 2 total)

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