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 |
|
DMP
Starting Member
41 Posts |
Posted - 2004-12-21 : 23:52:09
|
| How can i give the dynamic server reference in my T-SQL ?Example :Select * from DynamicServer.pubs.TitlesHere DynamicServer name comes from another table which is a Varchar field. |
|
|
hgorijal
Constraint Violating Yak Guru
277 Posts |
Posted - 2004-12-22 : 01:19:59
|
| use Dynamic SQL.exec('select * from ' + @DynamicServer_variable + '.pubs..titles')Hemanth GorijalaExchange a Dollar, we still have ONE each._______Exchange an Idea, we both have TWO each. |
 |
|
|
DMP
Starting Member
41 Posts |
Posted - 2004-12-22 : 01:32:27
|
| Thanks hgorijal,But I need without converting the SQL to StringHow is it possible ? |
 |
|
|
hgorijal
Constraint Violating Yak Guru
277 Posts |
Posted - 2004-12-22 : 05:17:56
|
| nope... can't doHemanth GorijalaExchange a Dollar, we still have ONE each._______Exchange an Idea, we both have TWO each. |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2004-12-22 : 07:27:38
|
| EXEC (@DynamicServer_variable + '.dbo.MyStoredProcedureStoredInThatDatabase')perhaps?Kristen |
 |
|
|
|
|
|