Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am using Sql Server 2005.

I wanted to take back up of my database through simple sql command.

For this i refered THIS doccument.

Made command as follows:

backup database webbasednewsoft to disk 'e:\wb.bak'

but its giving me error as:

Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'e:\wb.bak'.

I dont understand what is syntax error in this?

I have made everything according to doccument.

I thought the issue was for escape sequence, hence i also tried,

backup database webbasednewsoft to disk 'e:\\wb.bak'

But the error was same.

Please guid me for this.

share|improve this question

1 Answer

up vote 5 down vote accepted

You need an = sign.

 backup database webbasednewsoft to disk='e:\wb.bak'

See here for the MSDN for the BACKUP command

And if you look at your reference it too mentions using an = sign! but hey we're all guilty of eager reading I know I do it... :-)

share|improve this answer
Ohh, this worked, really a silly mistake. But i am not able to find .bak file on E:\ drive. what can be the problem? – Freelancer 10 hours ago
It will be the E:\ on the DB server – Preet Sangha 9 hours ago
ohh, thank you very much sir. – Freelancer 9 hours ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.