Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why does BACKUP LOG... not parse properly

Status
Not open for further replies.

CInman

IS-IT--Management
Mar 15, 2001
81
0
0
GB
For some reason, the following command generates an error when parsed:

BACKUP LOG joebloggs WITH TRUNCATE_ONLY

and the error when parsed is:

Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'joebloggs'.

Does anyone know why?
 
Is joebloggs your DATABASE name?

The correct syntax is:

BACKUP LOG databasename WITH TRUNCATE_ONLY

The command LOG lets it know to take the action on the LOG for the DATABASE named.

-SQLBill
 
Yeah, that is the database name, which is why I don't understand it?
 
I don't understand either. I checked the BOL and that's the correct syntax. Which database are you in when you parse it (ie. in Query Analyzer which database does it show you are using? or which one is in your USE command.)

-SQLBill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top