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 |
|
shubhada
Posting Yak Master
117 Posts |
Posted - 2005-11-07 : 01:48:17
|
| I have two database Database A and database B.I want to call one procedure of Database A into database B.shubhada |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-11-07 : 02:07:51
|
| Try thisEXEC DatabaseB..yourSp 'paramm1','param2' -- if anyMadhivananFailing to plan is Planning to fail |
 |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2005-11-07 : 02:08:25
|
| Exec DatabaseA..ProcName <Parameter>Hope this helps.Complicated things can be done by simple thinking |
 |
|
|
shubhada
Posting Yak Master
117 Posts |
Posted - 2005-11-07 : 02:25:05
|
| is it possible for me to create a link between two database?shubhada |
 |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2005-11-07 : 02:30:06
|
| what kind of link?you can create the sproc in one database, which contains statements querying in the tables of the other database--------------------keeping it simple... |
 |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2005-11-07 : 02:31:45
|
| what kind of link???.. .. are the 2 database on the same server.. ???then there is no need to create the link between them .. but if they are on different servers then you have to create the link between them .. by using this sp.. sp_addlinkedservertry searching on Book online for more details about this stored procedure.. Complicated things can be done by simple thinking |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-11-07 : 03:35:32
|
| If they are on the same database you can simply use DBName..ObjectNameMadhivananFailing to plan is Planning to fail |
 |
|
|
shubhada
Posting Yak Master
117 Posts |
Posted - 2005-11-07 : 04:41:35
|
| thanks a lotshubhada |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-11-07 : 05:42:16
|
| You can know more information on Linked server in the Books On Line, SQL Server help fileMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|