Sp_detach_db
May 19, 2000
I am moving an entire server on to a brand new box, I was going to use sp_detach_db and sp_attach_db to move all the databases including msdb, master, model, and distribution. The new server is going to be brought up with the same name and ip address as the old box and of course the old box will go off line. Are there any problems using sp_detach and sp_attach_db with these system databases?
View 2 Replies
Aug 31, 2005
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!
View 2 Replies
View Related
Apr 4, 2000
Here's one. :)
I have Database A in Server 1 which contains objects (tables and SPs) that are owned by users other than dbo. Then I detach this database from Server 1 using sp_detach_db and attach it to Server2 (sp_attach_db). Even if the same logins exist or are created in Server 2, I still won't be able to access the objects in Database A using these logins. I know that this happens because of different SIDs for the same login names across the 2 servers. So given that I want to achieve this without having to use the Import Wizard or any other method, how do I go around this lil bit of a problem? Any thoughts? :)
Thanks!
View 1 Replies
View Related
Jul 20, 2005
Hi,After a power outage (and UPS failure), my boss's SQL Server 2000 won'tstart (or crashes quickly or something). We don't have any backups, as it'sa test server. Is there a way to import the database files into a new SQLinstallation? By "installation," I mean either a re-installed SS, a secondinstallation on the same PC, or maybe even on another PC. In another words,given only the files sitting on the harddrive, is there a way to "import"the DBs in those files into SS?Sp_attach_db would probably be the answer, except it seems to requirerunning sp_detach_db...which I cannot do, as SS is not working.Thanks in advance,Jay
View 2 Replies
View Related