database naming  
Author Message
lukad2000





PostPosted: Fri Mar 17 20:42:21 CST 2006 Top

SQL Server >> database naming

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

SQL Server126  
 
 
Gail





PostPosted: Fri Mar 17 20:42:21 CST 2006 Top

SQL Server >> database naming 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



> 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


 
 
Rich





PostPosted: Mon Mar 20 10:29:27 CST 2006 Top

SQL Server >> database naming 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



> 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
>


> > 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
>
>
>
 
 
Gail





PostPosted: Mon Mar 20 11:47:36 CST 2006 Top

SQL Server >> database naming 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



> 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
>

>
>> 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
>>


>> > 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
>>
>>
>>