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 |
|
punitw
Starting Member
1 Post |
Posted - 2007-02-02 : 08:46:45
|
| I have a very simple Join Query likeSelect A, B , CFrom Database1.dbo.Table1 Inner Join Database2.dbo.Table2Now problem is that Database name for the project freuqently changes though Table1 and Table2 names remain constant.How can I store Datbase name at a central place in a table or as a constant so that I can use them in above query. It will allow me to change them at one place without making changes in all the sps where they are used |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2007-02-02 : 09:15:11
|
| You would have to use dynamic sql to do it.Another option is to use views and update the views when the database name is changed.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|