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.
Author |
Topic |
ineedhelp
Starting Member
11 Posts |
Posted - 2005-02-16 : 12:59:29
|
Hi,Microsoft website states clearly that "OPENQUERY does not accept variables for its arguments". Is there a workaround this?Basically, I want get the linked server name, catalog name, schema name etc from another table.So the least I have to achieve is the following:SELECT * FROM openquery ( @myserver, 'select * from tablename')Any ideas? ThanksThanks |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2005-02-16 : 13:01:07
|
use dynamic sql:exec('SELECT * FROM openquery ( ' + @myserver + ', '''select * from tablename''')'Go with the flow & have fun! Else fight the flow |
|
|
ineedhelp
Starting Member
11 Posts |
Posted - 2005-02-16 : 14:15:53
|
Thanks a ton, spirit1.Thanks |
|
|
|
|
|