Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 probleme with db name

Author  Topic 

joanne
Starting Member

46 Posts

Posted - 2005-11-22 : 10:33:18
Hi,

I have an application that generates databases. The name of the db generated is like that “Software Manager Database”.

When I run the restore on query analyzer, all work fine:

restore database "Software Manager Database"
from disk = @filename
with replace

But when I put the command I my job I have this error:
Error 170:line 25:Incorect syntax near ‘Software Manager Database’.

Can you help me, please?
Many thanks!

mcrowley
Aged Yak Warrior

771 Posts

Posted - 2005-11-22 : 10:47:31
Try this:

restore database [Software Manager Database]
from disk = @filename
with replace


Alternatively

set quoted_identifier on
go
restore database "Software Manager Database"
from disk = @filename
with replace


Can I just say that I hate it when vendors force a database name with a space in it on you?
Go to Top of Page

joanne
Starting Member

46 Posts

Posted - 2005-11-22 : 12:44:19
Thanks,
set quoted_identifier on
work well.
thanks again!
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-11-23 : 00:39:56
>>"Software Manager Database"

When naming the Object names dont use Space instead use underscore(_) like
Software_Manager_Database so that it will be easy to use them in the query


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -