471,119 Members | 1,362 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,119 software developers and data experts.

T-SQL script for tran log with - in database name

Hi,

This is probably a trivial question, as I am simply trying to execute a
BACKUP LOG database WITH NO_LOG. Except T-SQL will not accept anything
I type when database has a - in it, for example data-base. I have
tried:

BACKUP LOG 'data-base' WITH NO_LOG
BACKUP LOG "data-base" WITH NO_LOG
BACKUP LOG (data-base) WITH NO_LOG
BACKUP LOG N'data-base' WITH NO_LOG
BACKUP LOG N"data-base" WITH NO_LOG
BACKUP LOG N('data-base') WITH NO_LOG
BACKUP LOG N("data-base") WITH NO_LOG

All T-SQL will tell me is "syntax error" and Books Online has no
information. So... ???

Thank you!

Jul 23 '05 #1
1 1511
BACKUP LOG [data-base] WITH NO_LOG

See "Delimited Identifiers", "Using Identifiers" and QUOTENAME() in
Books Online. It's usually best to stick to letters and digits only for
identifiers.

Simon

Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by E | last post: by
1 post views Thread by Trent | last post: by
2 posts views Thread by David C. Barber | last post: by
6 posts views Thread by craigkenisston | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.