sqlAdapter

M

MikeJ

sqldapter ms sqlserver 2005
hi i have a main database
1 databasemain
2 databaseother

i have a stored proc in databaseother
i get error could not find stored procedure
the Proc is in Databaseother
when SqlAdapter opens the connection i need to change
to database other....

i dont know when Adapter opens the connection

if i open with sqlcommand ..changes to databaseother just fine

Tia
Analizer1

how can i change database
 
M

Marc Gravell

Opening a connection to database A and then immediately changing to B?
Why not just open a connection to B in the first place? 2 connection
will work just fine... Of course, within SQL you could use the longer
database.owner.object syntax to cross-call, but I don't advise it, as
I prefer a database to be able to stand by itself (so that I can
relocate databases between servers without issues, or take one
offline, etc). Another option (depending on the context) may be to
place the SP in "master", which should make it more-or-less visible to
all databases.

Marc
 
A

Analizer1

one of them long Proc names i had a incorrect letter
this servers talks more than one databases in a multi type and multitheaded
service
1st proc is a call to main database to get work to do on 2nd database

got it all working
thank you very much
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top