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
 General SQL Server Forums
 New to SQL Server Programming
 sp_detach_db fails periodcally

Author  Topic 

csmalley
Starting Member

2 Posts

Posted - 2005-08-31 : 16:47:17
We have a nightly DTS package that recreates a 'day-old' Student info database from downloads of our mainframe student database. It creates two temporary databases (Stage1 and Stage2), folds the Stage1 tables into the Stage2 database (I won't bore you with why), detaches the Stage2 database and the current 'day old' Student database, changes the names of the database files (Student to Old_student, Stage2 to Student) and re-attaches the new student database. The DTS tasks that detach the databases KILL any processes that are attached to the databases first.
The problem that we're having is that the detaches of the Stage2 and Student databases work fine for weeks or even months and then start failing. (Even when I haven't changed anything!) I've tried a few things to try and find why, but haven't had any luck.
What could be causing the failures and how can I trap the cause?


Thanks in advance!

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2005-08-31 : 20:22:33
What errors do you get? Do you schedule this job to run using SQLAgent?



-ec
Go to Top of Page

csmalley
Starting Member

2 Posts

Posted - 2005-09-01 : 12:37:25
Yes, it's run via SQLagent nightly. That's my main problem with this - I can't seem to make it tell me any error messages. And when I run the DTS task manually in the morning, it always runs ok.
Go to Top of Page
   

- Advertisement -