Home All Groups Group Topic Archive Search About


Author
17 Mar 2006 9:14 PM
Rich
Hello Group,

where does it talk about naming databases in the books online?  I thought
that a database name could not have a dash "-" in the name?

Rich

Author
18 Mar 2006 2:42 AM
Gail Erickson [MS]
The topic is "Identifiers"
http://msdn2.microsoft.com/en-us/library/ms175874(SQL.90).aspx  .See the
section "Rules for Regular Identifiers".

The only way you can includ special characters like a dash is to delimit the
name with [ ] or qoutes.  See the topic "Delimited Identifiers" for more
details.
-- This fails
create database my-database
-- This works
create database [my-database]

--
Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights

Show quoteHide quote
"Rich" <R***@discussions.microsoft.com> wrote in message
news:52512AC5-DADA-4C44-83AB-D9C5A635A7B9@microsoft.com...
> Hello Group,
>
> where does it talk about naming databases in the books online?  I thought
> that a database name could not have a dash "-" in the name?
>
> Rich
Are all your drivers up to date? click for free checkup

Author
20 Mar 2006 4:29 PM
Rich
Hello Gail,

here is the command I am running in the QA:

        backup log intrel-dev with truncate_only

and the error I get:

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

I suspect that the database name cannot have the dash in it.
Rich

Show quoteHide quote
"Gail Erickson [MS]" wrote:

> The topic is "Identifiers"
> http://msdn2.microsoft.com/en-us/library/ms175874(SQL.90).aspx  .See the
> section "Rules for Regular Identifiers".
>
> The only way you can includ special characters like a dash is to delimit the
> name with [ ] or qoutes.  See the topic "Delimited Identifiers" for more
> details.
> -- This fails
> create database my-database
> -- This works
> create database [my-database]
>
> --
> Gail Erickson [MS]
> SQL Server Documentation Team
> This posting is provided "AS IS" with no warranties, and confers no rights
>
> "Rich" <R***@discussions.microsoft.com> wrote in message
> news:52512AC5-DADA-4C44-83AB-D9C5A635A7B9@microsoft.com...
> > Hello Group,
> >
> > where does it talk about naming databases in the books online?  I thought
> > that a database name could not have a dash "-" in the name?
> >
> > Rich
>
>
>
Author
20 Mar 2006 5:47 PM
Gail Erickson [MS]
Did you try delimiting the name with [ ] or qoutes?  As in,  backup log
[intrel-dev] with truncate_only

--
Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights

Show quoteHide quote
"Rich" <R***@discussions.microsoft.com> wrote in message
news:059836F7-2E73-4340-BC3C-3FE3E4B3AC7D@microsoft.com...
> Hello Gail,
>
> here is the command I am running in the QA:
>
>        backup log intrel-dev with truncate_only
>
> and the error I get:
>
>        Server: Msg 170, Level 15, State 1, Line 1
>        Line 1: Incorrect syntax near '-'.
>
> I suspect that the database name cannot have the dash in it.
> Rich
>
> "Gail Erickson [MS]" wrote:
>
>> The topic is "Identifiers"
>> http://msdn2.microsoft.com/en-us/library/ms175874(SQL.90).aspx  .See the
>> section "Rules for Regular Identifiers".
>>
>> The only way you can includ special characters like a dash is to delimit
>> the
>> name with [ ] or qoutes.  See the topic "Delimited Identifiers" for more
>> details.
>> -- This fails
>> create database my-database
>> -- This works
>> create database [my-database]
>>
>> --
>> Gail Erickson [MS]
>> SQL Server Documentation Team
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights
>>
>> "Rich" <R***@discussions.microsoft.com> wrote in message
>> news:52512AC5-DADA-4C44-83AB-D9C5A635A7B9@microsoft.com...
>> > Hello Group,
>> >
>> > where does it talk about naming databases in the books online?  I
>> > thought
>> > that a database name could not have a dash "-" in the name?
>> >
>> > Rich
>>
>>
>>

Bookmark and Share