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 |
|
aravindt77
Posting Yak Master
120 Posts |
Posted - 2007-12-12 : 00:02:09
|
| Hi,This is very urgent and a complex matter as far as I m concernded..so I thank in advance for those whose made effort in attempting the problem...The scenario is that There are several database .. ie a MAsterDB and no of DetailsDBI want to execute a SP in DetailsDB from MasterDB and should get the OUTPUTparameter value in MasterDB ieSP in DetailsDB----------------Create proc detailssp(@inp int , @dop int OUTPUT)ASBEGIN IF @inp < 5 set @dop = @inp * 2 else set @dop - @inp * 10returnENDSP in MasterDB--------------Create proc Mastersp (@dbname nvARCHAR(50) , @minp int , @mop int OUTPUT)ASBEGIN ---- (@dbname is the name of DetailsDB) HERE I need a statement to call the SP in Corresponding database Database name is in the paramerter @dbname Also need the output variable value from that SP in @mop variableENDThanks & RegardsAravind |
|
|
jezemine
Master Smack Fu Yak Hacker
2886 Posts |
Posted - 2007-12-12 : 00:10:24
|
only way to do this is with dynamic sql. this seems like a poor design to me. elsasoft.org |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-12-12 : 01:03:16
|
| www.sommarskog.se/dynamic_sql.htmlMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|