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
 Detach Database.

Author  Topic 

ajeet84
Starting Member

6 Posts

Posted - 2008-06-18 : 09:20:03
hi
Please help me .I have detached a database in sql server 2005 using object browser. Now i cant see the database in object browser of sql server management studio .I tried to attach it but the mdf file of that database is missing in the data folder. i had not created the backup.
Can any one help me how to reattach that database.I will be very thankful to him..

thanks !!
Ajeet

Ajeet Kumar
Software Developer
Ustech
India

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-06-18 : 09:25:28
You won't be able to see after detaching. DOn't you know where you have your Data files for that database?
Go to Top of Page

ajeet84
Starting Member

6 Posts

Posted - 2008-06-18 : 12:04:45
yeah i cant find the database file so that i can reattach it.

Ajeet Kumar
Software Developer
Ustech
India
Go to Top of Page

tosscrosby
Aged Yak Warrior

676 Posts

Posted - 2008-06-18 : 12:21:21
A detach will not delete the underlying data files. Search for *.mdf on all your physical drives to see if it's somewhere else. If not and they've been deleted, and no backups, your position is not the best one to be in. You can find some third party tools that can retrieve deleted files from disk. I've never used them and don't know what it would cost, but they do exist. Google it.

Terry
Go to Top of Page

ajeet84
Starting Member

6 Posts

Posted - 2008-06-18 : 12:40:39
ok.sir thanks for your reply. i could not find that mdf file anyhow.Can you please tell me how to move database from one system to another system.

thanks!!

Ajeet Kumar
Software Developer
Ustech
India
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-06-18 : 12:59:37
quote:
Originally posted by ajeet84

ok.sir thanks for your reply. i could not find that mdf file anyhow.Can you please tell me how to move database from one system to another system.

thanks!!

Ajeet Kumar
Software Developer
Ustech
India


Note that you should search for files in Server's directory and not in Client's directory

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

ajeet84
Starting Member

6 Posts

Posted - 2008-06-18 : 13:14:14
sir its my only pc which has both client and server. leave that please tell me what is safest way to move database..

thanks !!

Ajeet Kumar
Software Developer
Ustech
India
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-06-18 : 13:19:52
That's why you should have backup of database. How can you move without finding mdf and ldf files?
Go to Top of Page

ajeet84
Starting Member

6 Posts

Posted - 2008-06-18 : 13:41:48
sir i cant move that files which i did not find.but i have another db which i have to move.please give me the idea how can i do it..

thanks !!

Ajeet Kumar
Software Developer
Ustech
India
Go to Top of Page

Van
Constraint Violating Yak Guru

462 Posts

Posted - 2008-06-18 : 13:44:49
You can detach it and reattach it to the server you want it to be on...hehe

Or the better choice in my opinion is to backup the db and restore it where you need it.
Go to Top of Page

ajeet84
Starting Member

6 Posts

Posted - 2008-06-18 : 14:31:28
thank u sir..thank u very much...




Ajeet Kumar
Software Developer
Ustech
India
Go to Top of Page
   

- Advertisement -