SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 sql server db backup from other computer
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

hameedf
Starting Member

Pakistan
27 Posts

Posted - 12/10/2012 :  12:22:32  Show Profile  Reply with Quote
Hello experts !

how to take cold backup of sqlserver database from other computer via command prompt batch file?

i appreciate your help please

Thanks

Hameed

tkizer
Almighty SQL Goddess

USA
36985 Posts

Posted - 12/10/2012 :  14:50:07  Show Profile  Visit tkizer's Homepage  Reply with Quote
Why do you want to do a cold backup? A hot backup works perfect in SQL Server and requires zero downtime.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

hameedf
Starting Member

Pakistan
27 Posts

Posted - 12/10/2012 :  14:57:31  Show Profile  Reply with Quote
Fine thanks please guide me how to take hot backup?

cheers

Hameed
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
36985 Posts

Posted - 12/10/2012 :  15:16:01  Show Profile  Visit tkizer's Homepage  Reply with Quote
You would issue the BACKUP DATABASE command.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

hameedf
Starting Member

Pakistan
27 Posts

Posted - 12/10/2012 :  16:02:42  Show Profile  Reply with Quote
Sorry i am very new to sql server shall you please tell me how to make a batch file?

Thanks

Hameed
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
36985 Posts

Posted - 12/10/2012 :  16:34:54  Show Profile  Visit tkizer's Homepage  Reply with Quote
Making a batch file isn't actually a SQL Server thing. Why do you need to use a batch file? If you just want to schedule a backup, you would create a job in the SQL Server Agent.

If you are dead set on using a batch file, you would issue the BACKUP DATABASE command via sqlcmd.exe.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

hameedf
Starting Member

Pakistan
27 Posts

Posted - 12/11/2012 :  13:57:08  Show Profile  Reply with Quote
Actually sir i other computer i dont have sql server i want to use native clien and command line sql tool to get the backup of the server to my computer?

Thanks

Hameed
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
36985 Posts

Posted - 12/11/2012 :  14:10:09  Show Profile  Visit tkizer's Homepage  Reply with Quote
What do you mean by native client?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

hameedf
Starting Member

Pakistan
27 Posts

Posted - 12/11/2012 :  14:20:12  Show Profile  Reply with Quote
Sql native client...

Hameed
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
36985 Posts

Posted - 12/11/2012 :  14:22:18  Show Profile  Visit tkizer's Homepage  Reply with Quote
Do you have sqlcmd.exe on your machine?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

hameedf
Starting Member

Pakistan
27 Posts

Posted - 12/11/2012 :  14:28:12  Show Profile  Reply with Quote
yes i have this utility in my machine...

Thanks

Hameed
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
36985 Posts

Posted - 12/11/2012 :  14:52:37  Show Profile  Visit tkizer's Homepage  Reply with Quote
Here is a sample: sqlcmd.exe -Sserver1\instance1 -E -ic:\temp\SomeScript.sql

SomeScript.sql:
BACKUP DATABASE Test TO DISK = '\\server2\f$\backup\Test.bak'

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000