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.
Author |
Topic |
bharath_kolanda
Starting Member
6 Posts |
Posted - 2009-10-12 : 08:25:15
|
Hello Everyone, I am facing some problems while attaching database to server. Here is my problem. My application will attach the database to SQlServer, when application started, and detach it before closing the application. After detaching i am removing the ldf file. Suppose if the application crashes or if we terminate the appllciation from task manager, the next time attching will have problem. The next time it will attach properly. Please help how to solve this problem. Thanks and Regards,Bharath kumar.K |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
|
bharath_kolanda
Starting Member
6 Posts |
Posted - 2009-10-13 : 00:59:48
|
Hi, Even if dont remove the log file after detaching, and if close by application abruptly (using tak manager), the next time while attaching it showing problem. before attaching i am checking whether the same database is already attached or not, if it is attached i am detaching the database by killing the process and then tryring to attach. Even after doing this attaching is failing.Regards,Bharath kumar.K |
 |
|
bharath_kolanda
Starting Member
6 Posts |
Posted - 2009-10-13 : 01:13:17
|
Hi, Ifound out the problem, after detaching the database, i am attaching it directly, becuase of this the problem is coming. I just refreshed the databases and then atatched. Now the error is not coming and database is attaching properly. Thanking for your time.Regards,Bharath kumar.K |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2009-10-13 : 03:28:52
|
quote: Originally posted by tkizer I hope you aren't developing this application for a company and that it is just a test system. You should truly reconsider your design.
Agreed. You should attach the DB once and leave it attached when the app terminates. There is no good reason to detach the DB once the app closes down.--Gail ShawSQL Server MVP |
 |
|
|
|
|
|
|