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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 "File being used by another process" error

Author  Topic 

parrot
Posting Yak Master

132 Posts

Posted - 2010-01-25 : 11:40:53
A prospective client of mine is getting an error message when trying to access the SQL data base I provided for their testing. The error message says that the SQL database file is being used by another process. I cannot duplicate this error on my computer. Can anyone give me possible reasons for this error? If I don't resolve this I will lose my sale! HELP

Dave

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-01-25 : 11:42:06
make sure virus scanner is ignoring *.mdf, *.ldf and SQL Server directories
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-01-25 : 11:43:21
also, how are they trying to access it? and how did you "provide" it to them?
Go to Top of Page

parrot
Posting Yak Master

132 Posts

Posted - 2010-01-26 : 10:39:54
Russell;
Thanks for your reply. They are trying to access it as a read only file. I sent them a program written in C# with my database attached. They are able to access the database using SQL Server Management Studio but when they try to select records for reporting using my program they get the 'file being used by another process' error. They are in another country and time zone and I cannot communicate with them during working hours, so it is very frustrating to try the resolve it without giving them the impression that it is their problem and not mine.

I will let them know about the virus scans to see if that helps.

Dave
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-01-26 : 10:45:14
Is the the database set to AutoClose? I *think* that if that is turned off SQL will keep the file open - i.e. keep the file "in use" itself - which might help?
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-01-26 : 10:45:58
(I think that AUTOCLOSE = ON is the default if the DB was created in SQL Express, otherwise the default is OFF, but you can set it to be whichever you want, of course)
Go to Top of Page

parrot
Posting Yak Master

132 Posts

Posted - 2010-01-26 : 12:30:09
Kristen;
Thanks for your reply. I will send this message to the client and see if setting the database to AutoClose will make a difference. I won't know until tomorrow since they are 8000 miles away. My database is set to False for AutoClose and still can't duplicate his error. Very frustrating.
Dave
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-01-26 : 12:33:38
"My database is set to False for AutoClose"

The copy you sent them will be the same (I doubt they've changed it ... but they might have I suppose)

Note that AUTOCLOSE=ON will close the database when all connections are "quiet" (which might allow Virus Checker or something-else to open the file).

AUTOCLOSE=OFF should mean that SQL keeps the file open itself (but I don't know for sure that it does that)
Go to Top of Page
   

- Advertisement -