3

I am trying to take a backup on a Windows Server 2003 and SQL Server 2005 installed on it. But, there is no SQL Server Management Studio on it. How can I take full backup of a particular database.

asked Sep 19, 2014 at 14:51
3
  • 1
    sqlcmd to run your backup script Commented Sep 19, 2014 at 14:54
  • In addition, if you have SSMS installed on your desktop (and you have sufficient rights) you can issue the command from your desktop. Commented Sep 19, 2014 at 14:58
  • I would second running the backup via ssms on your desktop unless you can't for some reason. Commented Sep 12, 2018 at 2:57

2 Answers 2

3

You can use sqlcmd from the command prompt.

It's default location for SQL 2012 is here :- C:\Program Files\Microsoft SQL Server110円\Tools\Binn

For windows authentication run :- sqlcmd -SSERVERNAME

or for sql authentication run:- sqlcmd -SSERVERNAME -ULogin -PPassword

You can then run a backup sql statement.

http://msdn.microsoft.com/en-us/library/ms180944.aspx

answered Sep 19, 2014 at 14:58
5
  • Needs moar PowerShell Commented Sep 19, 2014 at 15:05
  • Sorry, do you mean you want to run it in powershell? Commented Sep 19, 2014 at 15:07
  • Just being obnoxious. ;) I'd have gone sqlcmd route myself but was just pointing out the capability and infatuation with PS many DBAs have Commented Sep 19, 2014 at 15:11
  • PS is the way to go, Backup-SqlDatabase -ServerInstance servername -Database databasename Commented Sep 11, 2018 at 20:40
  • 2005 doesn't like Backup-SqlDatabase : Backup to URL device is not supported on server version 9.0.1 Commented Nov 5, 2018 at 17:47
2

Try this in command promt

In winodws authentication mode

SQLCMD -E -S SERVERNAME -Q "BACKUP DATABASE DatabaseName TO DISK='D:\Backup\DatabaseName.bak'"

In Sql Authentication mode

SQLCMD -S SERVERNAME -U sqlUser -P Password 

then run the BACKUP DATABASE DatabaseName TO DISK='D:\Backup\DatabaseName.bak' in next step

answered Sep 19, 2014 at 15:09

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.