2

I'm trying to do a full backup of my database by entering the following:

BACKUP DATABASE 10997_diamondtransportinccom
TO DISK = 'D:\10997diamond.BAK';

But it gives me the following error:

Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '10997'.

Please advice. Thanks.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
sony
  • 21
  • 2

1 Answers1

1

Should be:

BACKUP DATABASE [10997_diamondtransportinccom] TO DISK = 'D:\10997diamond.BAK'

[Note: square brackets]

See Identifiers

Mitch Wheat
  • 295,962
  • 43
  • 465
  • 541
  • Because 10997_diamondtransportinccom is not a valid SQL identifier and so must be quoted. I figure someone will ask why, so I thought I would answer. – drdwilcox Nov 16 '11 at 00:05
  • actually. isn't the problem the leading digit on the identifier? – drdwilcox Nov 16 '11 at 00:07