Michael,
- what interface are you using to connect to SQL Server from your applicatio
n?
- can you post the code where you set the connection properties?
AMB
"Michael MacGregor" wrote:
> An interesting error occurred today along with some inconsistent behaviour
.
> On our test database we have one database, that is the main one and in whi
ch
> all the SPs are located. Then we have a secondary database, the data in
> which is accessed only by stored procs run from the main database. Recentl
y
> we updated this secondary database by dropping the old one and recreating
> it. This changed, presumably, the db_id for that database, same name.
> Now when we tried to run any of the SPs that access this secondary databas
e,
> they caused error number 913, "Could not find database ID %d. Database may
> not be activated yet or may be in transition." Which seems logical if the
> secondary database now has a different db_id from the old one that was
> dropped. However, when the same SPs are executed in Query Analyzer, they r
un
> fine, no error, and they return data.
> Any idea what's going on? Why would execution of the SPs cause an error fr
om
> the application viewpoint but not in Query Analyzer?
> This really has me puzzled.
> TIA
> Michael MacGregor
> Database Architect
>
>An interesting error occurred today along with some inconsistent behaviour.
On our test database we have one database, that is the main one and in which
all the SPs are located. Then we have a secondary database, the data in
which is accessed only by stored procs run from the main database. Recently
we updated this secondary database by dropping the old one and recreating
it. This changed, presumably, the db_id for that database, same name.
Now when we tried to run any of the SPs that access this secondary database,
they caused error number 913, "Could not find database ID %d. Database may
not be activated yet or may be in transition." Which seems logical if the
secondary database now has a different db_id from the old one that was
dropped. However, when the same SPs are executed in Query Analyzer, they run
fine, no error, and they return data.
Any idea what's going on? Why would execution of the SPs cause an error from
the application viewpoint but not in Query Analyzer?
This really has me puzzled.
TIA
Michael MacGregor
Database Architect|||Michael,
- what interface are you using to connect to SQL Server from your applicatio
n?
- can you post the code where you set the connection properties?
AMB
"Michael MacGregor" wrote:
> An interesting error occurred today along with some inconsistent behaviour
.
> On our test database we have one database, that is the main one and in whi
ch
> all the SPs are located. Then we have a secondary database, the data in
> which is accessed only by stored procs run from the main database. Recentl
y
> we updated this secondary database by dropping the old one and recreating
> it. This changed, presumably, the db_id for that database, same name.
> Now when we tried to run any of the SPs that access this secondary databas
e,
> they caused error number 913, "Could not find database ID %d. Database may
> not be activated yet or may be in transition." Which seems logical if the
> secondary database now has a different db_id from the old one that was
> dropped. However, when the same SPs are executed in Query Analyzer, they r
un
> fine, no error, and they return data.
> Any idea what's going on? Why would execution of the SPs cause an error fr
om
> the application viewpoint but not in Query Analyzer?
> This really has me puzzled.
> TIA
> Michael MacGregor
> Database Architect
>
>|||This is what my Java guy gave me when I asked him for the information. Is
this what you wanted?
public static String strDbUser =
"<userID>";
public static String strDbPwd =
"<pwd>";
public static String strDefaultServer = "<sqlserver>";
A JDBC SQL server driver is being used as an interface between the Java app
and sql server.
"Alejandro Mesa" <AlejandroMesa@.discussions.microsoft.com> wrote in message
news:75FF2CB6-94CB-423B-A17F-EEE0688825A6@.microsoft.com...[vbcol=seagreen]
> Michael,
> - what interface are you using to connect to SQL Server from your
> application?
> - can you post the code where you set the connection properties?
>
> AMB
> "Michael MacGregor" wrote:
>|||Michael,
Seems like the connection is using the default database for that user. If
the default db was pointing to the the one you recreated, then the default d
b
for that user is pointing to the wrong db_id. You will have to change the
default db for your users, using sp_defaultdb.
AMB
"Michael MacGregor" wrote:
> This is what my Java guy gave me when I asked him for the information. Is
> this what you wanted?
> public static String strDbUser =
> "<userID>";
> public static String strDbPwd =
> "<pwd>";
> public static String strDefaultServer = "<sqlserver>";
> A JDBC SQL server driver is being used as an interface between the Java ap
p
> and sql server.
> "Alejandro Mesa" <AlejandroMesa@.discussions.microsoft.com> wrote in messag
e
> news:75FF2CB6-94CB-423B-A17F-EEE0688825A6@.microsoft.com...
>
>|||Forgot to mention that you can also specify the db to which you want to
connect in the connection properties. I am not familiar with JDBC but this
should be something comon in every interface.
AMB
"Alejandro Mesa" wrote:
[vbcol=seagreen]
> Michael,
> Seems like the connection is using the default database for that user. If
> the default db was pointing to the the one you recreated, then the default
db
> for that user is pointing to the wrong db_id. You will have to change the
> default db for your users, using sp_defaultdb.
>
> AMB
>
> "Michael MacGregor" wrote:
>|||This is what my Java guy gave me when I asked him for the information. Is
this what you wanted?
public static String strDbUser =
"<userID>";
public static String strDbPwd =
"<pwd>";
public static String strDefaultServer = "<sqlserver>";
A JDBC SQL server driver is being used as an interface between the Java app
and sql server.
"Alejandro Mesa" <AlejandroMesa@.discussions.microsoft.com> wrote in message
news:75FF2CB6-94CB-423B-A17F-EEE0688825A6@.microsoft.com...[vbcol=seagreen]
> Michael,
> - what interface are you using to connect to SQL Server from your
> application?
> - can you post the code where you set the connection properties?
>
> AMB
> "Michael MacGregor" wrote:
>|||Michael,
Seems like the connection is using the default database for that user. If
the default db was pointing to the the one you recreated, then the default d
b
for that user is pointing to the wrong db_id. You will have to change the
default db for your users, using sp_defaultdb.
AMB
"Michael MacGregor" wrote:
> This is what my Java guy gave me when I asked him for the information. Is
> this what you wanted?
> public static String strDbUser =
> "<userID>";
> public static String strDbPwd =
> "<pwd>";
> public static String strDefaultServer = "<sqlserver>";
> A JDBC SQL server driver is being used as an interface between the Java ap
p
> and sql server.
> "Alejandro Mesa" <AlejandroMesa@.discussions.microsoft.com> wrote in messag
e
> news:75FF2CB6-94CB-423B-A17F-EEE0688825A6@.microsoft.com...
>
>|||Forgot to mention that you can also specify the db to which you want to
connect in the connection properties. I am not familiar with JDBC but this
should be something comon in every interface.
AMB
"Alejandro Mesa" wrote:
[vbcol=seagreen]
> Michael,
> Seems like the connection is using the default database for that user. If
> the default db was pointing to the the one you recreated, then the default
db
> for that user is pointing to the wrong db_id. You will have to change the
> default db for your users, using sp_defaultdb.
>
> AMB
>
> "Michael MacGregor" wrote:
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment