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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Scheduled SQL jobs are failing!!

Author  Topic 

sqlserverdeveloper
Posting Yak Master

243 Posts

Posted - 2008-09-30 : 15:27:42
Hi, Our 3 scheduled SQL jobs failed last night, basically these jobs run DTS packages. I am getting the below error:
Error: -2147467259 (80004005); Provider Error: 4064 (FE0)
Error string: Cannot open user default database. Login failed.
Error source: Microsoft OLE DB Provider for SQL Server
Help file:
Help context: 0
Thanks!

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-09-30 : 15:34:59
What happens when you fix the default database for the login?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

sqlserverdeveloper
Posting Yak Master

243 Posts

Posted - 2008-09-30 : 15:44:29
How do I fix the default db for the login?
Do I need to run the below code at the command prompt, if so what 'New default database' should I use?
OSQL -E -S "Servername" -d master -Q "EXEC sp_defaultdb 'Login', 'New default database'"
Thanks!
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-09-30 : 15:55:47
Go to the login in Management Studio and check what default database it has. According to the error, the default databsae is wrong meaning it either doesn't exist or the account doesn't have access to it. It must be a valid database that it has access to in order to avoid the error.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

sqlserverdeveloper
Posting Yak Master

243 Posts

Posted - 2008-09-30 : 16:09:59
BTW that error is occuring on SQL 2000, those jobs were running fine till yesterday. All of a sudden I started getting this error.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-09-30 : 16:13:48
And have you fixed the default database? Did somebody perform a restore of some database or delete a database since yesterday?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

sqlserverdeveloper
Posting Yak Master

243 Posts

Posted - 2008-09-30 : 16:34:32
I fixed the default DB to master for that sa login. Actually we removed a database from that server by detaching the database and deleting the mdf and ldf files for that db which we no longer need. So did this removing of the database from the server caused this issue? Thanks!
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-09-30 : 16:36:47
Yes, it caused the issue. You removed the database and a login was using it as the default database.

Why are you using sa for this?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

sqlserverdeveloper
Posting Yak Master

243 Posts

Posted - 2008-09-30 : 16:58:38
Actually sa was using a existing db as a default db, I do'nt think that login was using the removed database as the default db. But anyways, I changed the default db to master DB now.
Usually which login do we use for running the sql jobs?
Thanks!
Go to Top of Page
   

- Advertisement -