openrowset function

  • Hi

    I have 2 sql servers SQL1 and SQL2. SQL1 contains a table employees.

    I want to query the table from SQL2 by openrowset function.

    please give me the query

    Binu

  • here you go, from Books On Line:

    SELECT a.*

    FROM OPENROWSET('SQLNCLI', 'Server=Seattle1;Trusted_Connection=yes;',

    'SELECT GroupName, Name, DepartmentID

    FROM AdventureWorks.HumanResources.Department

    ORDER BY GroupName, Name') AS a;

    openrowset is by default disabled in SQL 2005.

    ...and your only reply is slàinte mhath

  • Thanks

    What is the syntaxt in sql 2000 server

    Binu

  • Sorry, I don't want to be offensive, but you don't have by any chance BOL installed on your machine?

    Syntax is same. I just checked.

    ...and your only reply is slàinte mhath

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

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