| Author |
Topic |
|
sunsanvin
Master Smack Fu Yak Hacker
1274 Posts |
Posted - 2007-10-01 : 02:27:15
|
| Dear All,i've detached my database. how to attache thesame again?VinodEven you learn 1%, Learn it with 100% confidence. |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-10-01 : 02:31:49
|
| Make use of sp_attach_db stored proc.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2007-10-01 : 02:36:53
|
| See also: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=single%20file%20attach,sp_attach_single_file_db,attach,detach,Reattach |
 |
|
|
sunsanvin
Master Smack Fu Yak Hacker
1274 Posts |
Posted - 2007-10-01 : 02:37:12
|
| i've passed the parametre as the database name. but i'm getting error....shall i provide the path of the datafile and logfile?VinodEven you learn 1%, Learn it with 100% confidence. |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2007-10-01 : 02:44:08
|
| What's the error message you are getting? |
 |
|
|
sunsanvin
Master Smack Fu Yak Hacker
1274 Posts |
Posted - 2007-10-01 : 02:47:00
|
| i'm getting the error like thisProcedure 'sp_attach_db' expects parameter '@filename1', which was not supplied.VinodEven you learn 1%, Learn it with 100% confidence. |
 |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-10-01 : 02:51:00
|
| Did you at least check the documentation for sp_attach_db before using it?Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
sunsanvin
Master Smack Fu Yak Hacker
1274 Posts |
Posted - 2007-10-01 : 02:52:23
|
| i've gone through the enterprise manager, and by showing the MDF file path, i've attached the database....thank you very much...harsh and kiristen....and what exactly is the use of attaching and detaching the database?VinodEven you learn 1%, Learn it with 100% confidence. |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-10-01 : 03:26:28
|
the use is to quickly move it between servers if needed.it's not used very often but it's there to use... _______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com |
 |
|
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2007-10-01 : 05:29:43
|
| Also , although this not the best way to do things, you can quickly create a new Log file by detaching and then reattaching without specifying a Log file, this will create a fresh Log file. Useful , if you're having emergency space issuesJack Vamvas--------------------Search IT jobs from multiple sources- http://www.ITjobfeed.com/SQL |
 |
|
|
Lumbago
Norsk Yak Master
3271 Posts |
Posted - 2007-10-01 : 16:10:06
|
| It's aso a quick and dirty way of i.e. duplicating your database for dev/testing purposes...often you want to run tests on production data and if you can afford to take your prod database offline.--Lumbago"Real programmers don't document, if it was hard to write it should be hard to understand" |
 |
|
|
|