Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 What's the difference

Author  Topic 

johnoxy
Starting Member

10 Posts

Posted - 2007-03-21 : 19:35:39
Hi
Can anyone tell me what the basic difference between OPENDATASOURCE and OPENROWSET is? I can't execute sp_linkedserver as i don't have permissions so must use one of the above.

Cheers
J

snSQL
Master Smack Fu Yak Hacker

1837 Posts

Posted - 2007-03-22 : 13:20:10
They basically do the same thing, but they give you different ways constructing the statement that uses them. OPENROWSET replaces the whole table source, so you use it like this:
SELECT * FROM OPENROWSET(...)
whereas OPENDATASOURCE replaces the first part of a four part name so you use it like this:
SELECT * FROM OPENDATASOURCE(...).catalog.schema.table
Go to Top of Page
   

- Advertisement -