sign in | join about | help | sitemap
Connecting Tech Pros Worldwide
mo/-/sin's Avatar

database problem


Question posted by: mo/-/sin (Guest) on August 23rd, 2008 05:45 PM
hi i m mohsin....
i m making a project on hospital management using c# at front end and
sql server 2005 at backend.............
my project is almost complete but now i m facing a problem........
since i going to run the project on other systems also i m not able to
copy the the databases to any otherr folder which i made for the
project
the databases are in c drive where i installed sql server 2005 but
whenever i try o copy the databases it shows cannot copy city hospital
database to another folder.. it is being used by another folder..
plz help mee............
3 Answers Posted
Tom van Stiphout's Avatar
Tom van Stiphout August 23rd, 2008 06:05 PM
Guest - n/a Posts
#2: Re: database problem

On Sat, 23 Aug 2008 09:43:32 -0700 (PDT), "mo/-/sin"
<Ri.mohsin@gmail.comwrote:

I'm assuming you tried to copy the .mdf file. It is in use by SQL
Server. It's also not the recommended way to copy databases around.
Rather you should make a backup, and restore it on the other system.

-Tom.
Microsoft Access MVP

Quote:
Originally Posted by
>hi i m mohsin....
>i m making a project on hospital management using c# at front end and
>sql server 2005 at backend.............
>my project is almost complete but now i m facing a problem........
>since i going to run the project on other systems also i m not able to
>copy the the databases to any otherr folder which i made for the
>project
>the databases are in c drive where i installed sql server 2005 but
>whenever i try o copy the databases it shows cannot copy city hospital
>database to another folder.. it is being used by another folder..
>plz help mee............

mo/-/sin's Avatar
Guest - n/a Posts
#3: Re: database problem

On Aug 23, 9:58*pm, Tom van Stiphout <no.spam.tom7...@cox.netwrote:
Quote:
Originally Posted by
On Sat, 23 Aug 2008 09:43:32 -0700 (PDT), "mo/-/sin"
>
<Ri.moh...@gmail.comwrote:
>
I'm assuming you tried to copy the .mdf file. It is in use by SQL
Server. It's also not the recommended way to copy databases around.
Rather you should make a backup, and restore it on the other system.
>
-Tom.
Microsoft Access MVP
>
Quote:
Originally Posted by
hi i m mohsin....
i m making a project on hospital management using c# at front end and
sql server 2005 at backend.............
my project is almost complete but now i m facing a problem........
since i going to run the project on other systems also i m not able to
copy the the databases to any otherr folder which i made for the
project
the databases are in c drive where i installed sql server 2005 but
whenever i try o copy the databases it shows cannot copy city hospital
database to another folder.. it is being used by another folder..
plz help mee............


how i can make a backup............
Erland Sommarskog's Avatar
Erland Sommarskog August 24th, 2008 10:45 AM
Guest - n/a Posts
#4: Re: database problem

mo/-/sin (Ri.mohsin@gmail.com) writes:
Quote:
Originally Posted by
how i can make a backup............


BACKUP DATABASE db TO DISK = '<somepath>' WITH INIT

To restore in the other environment:

RESTORE DATABASE db FROM DISK = '<somepath>'
WITH MOVE 'datadev' TO 'filepath1.mdf',
MOVE 'logdev' TO 'filepath2.ldf',
REPLACE

"datadev" and "logdev" are the logical name for the database files. You
can see these with sp_helpdb in the first or second column. Filepath1
and filepath2 are simply the location for the database files on the
new server.


--
Erland Sommarskog, SQL Server MVP, Join Bytes!

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodin...ions/books.mspx

 
Not the answer you were looking for? Post your question . . .
197,049 members ready to help you find a solution.
Join Bytes.com

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 197,049 network members.
Post your question now . . .
It's fast and it's free

Popular Articles

Top Community Contributors