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
 General SQL Server Forums
 New to SQL Server Programming
 Create Database &%Test$

Author  Topic 

ZarrinPour
Yak Posting Veteran

66 Posts

Posted - 2007-10-08 : 07:50:05
Hi everybody
Have you ever noticed that you can create database with strange and unusual name with Enterprise manager but not with Query Analizer and through T-SQL code!!?

for example try to create database with name &%Test$
it will be created as i said earlier throgh Database Wizard in Enterprise manager but if you Execute :

Create Database &%Test$

you will receive the following error:
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near '&'.

Kristen
Test

22859 Posts

Posted - 2007-10-08 : 08:05:17
Create Database [&%Test$]
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-10-08 : 09:45:47
quote:
Originally posted by ZarrinPour

Hi everybody
Have you ever noticed that you can create database with strange and unusual name with Enterprise manager but not with Query Analizer and through T-SQL code!!?

for example try to create database with name &%Test$
it will be created as i said earlier throgh Database Wizard in Enterprise manager but if you Execute :

Create Database &%Test$

you will receive the following error:
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near '&'.



Make sure you follow good naming conventions

Madhivanan

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

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2007-10-08 : 09:53:17
here's my favorite:

create database [ ]


elsasoft.org
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-10-08 : 10:27:06
quote:
Originally posted by jezemine

here's my favorite:

create database [ ]


elsasoft.org


create database [Create database]


Madhivanan

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

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2007-10-08 : 10:50:58
create database [drop database master]


elsasoft.org
Go to Top of Page
   

- Advertisement -