This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JDBC and the fly likes how to use special characters in database name Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "how to use special characters in database name" Watch "how to use special characters in database name" New topic
Author

how to use special characters in database name

Nidhi Singhal
Ranch Hand

Joined: Sep 19, 2004
Posts: 89
Hi,

I am using osql (transact sql) for creating a new database in MSDE (Microsoft SQL Server Desktop Engine).

I want to use special characters in the database name:
like: MyDb.2003.7

But whenever I use '.' character in database name, it gives an error.

How should I go about creating a database with special charcters in it?

Thanks

Nidhi
Martin Simons
Ranch Hand

Joined: Mar 02, 2006
Posts: 196
Don't. It is not a good idea. Those types of characters in Database names were restricted for a reason. You might be able to get away with this sort of stuff by enclosing the name in quotes (either double or single), at least I know you can in MySQL. But then you must also remember to quote them whenever you use them, and it is advised against. So, as stated earlier, unless there is a very, very, very, compelling reason to do so, don't do it. It only leads to a lot of headaches, and possibly compatability issues as well.
[ July 28, 2006: Message edited by: Martin Simons ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to use special characters in database name
 
Similar Threads
Displaying Non-English Characters in XML attribute
Storing special characters(') into oracle
Encoding of special characters in the request parameter
Problem with escape chars...
Using special characters in java