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:
>
Showing posts with label michael. Show all posts
Showing posts with label michael. Show all posts
Friday, March 9, 2012
Error Msg
On Feb 8, 4:19 pm, "Michael" <michae...@.gmail.com> wrote:
> Hi,
> If I use SQL Server Agent-Jobs to create a job agent to run a stored
> procedure. Where the error message from the stored procedure will go
> to? Say, I set the job from today to tomorrow, running every hour.
> Thanks!
> Mike
What I mean here Error Msg is the text I use RAISEERROR to put in the
output window. Where the text message will go if I use job agent?
Thanks,
Mike
Michael,
If you view job history and click "Show step details", you will see the
errors and messages in the text box at the bottom of the window. There is a
limit to what you can see here if there are a lot of messages or errors. You
can also:
select message from the msdb..sysjobhistory table
(watch the date and time columns, they are funky and will have to be
converted).
If you want to store it all for later review, send the text out to a file.
Edit a job step and open the Advanced tab and you'll see a place for file
name and a check box to determine if you should append to the file or not.
-- Bill
"Michael" <michaelnx@.gmail.com> wrote in message
news:1170970322.522398.278850@.q2g2000cwa.googlegro ups.com...
> On Feb 8, 4:19 pm, "Michael" <michae...@.gmail.com> wrote:
> What I mean here Error Msg is the text I use RAISEERROR to put in the
> output window. Where the text message will go if I use job agent?
> Thanks,
> Mike
>
> Hi,
> If I use SQL Server Agent-Jobs to create a job agent to run a stored
> procedure. Where the error message from the stored procedure will go
> to? Say, I set the job from today to tomorrow, running every hour.
> Thanks!
> Mike
What I mean here Error Msg is the text I use RAISEERROR to put in the
output window. Where the text message will go if I use job agent?
Thanks,
Mike
Michael,
If you view job history and click "Show step details", you will see the
errors and messages in the text box at the bottom of the window. There is a
limit to what you can see here if there are a lot of messages or errors. You
can also:
select message from the msdb..sysjobhistory table
(watch the date and time columns, they are funky and will have to be
converted).
If you want to store it all for later review, send the text out to a file.
Edit a job step and open the Advanced tab and you'll see a place for file
name and a check box to determine if you should append to the file or not.
-- Bill
"Michael" <michaelnx@.gmail.com> wrote in message
news:1170970322.522398.278850@.q2g2000cwa.googlegro ups.com...
> On Feb 8, 4:19 pm, "Michael" <michae...@.gmail.com> wrote:
> What I mean here Error Msg is the text I use RAISEERROR to put in the
> output window. Where the text message will go if I use job agent?
> Thanks,
> Mike
>
Subscribe to:
Posts (Atom)