Wednesday, March 7, 2012

how can i use the " use " statement with database-name contains spaces in sql2000

example :

i cann't write :

use [my db]

what can i do with this problem ?

That works for me:

use [master]

CREATE DATABASE [Some DB]

USE [Some DB]

SELECT DB_NAME()

-

Some DB

(1 row(s) affected)

USE MASTER

DROP DATABASE [Some DB]

What error are you getting back ? Regardless of the possibiliy to put a space in the name, this is NOT recommended. It might work in the most cases but you will run in many cases where this isn′t supported (liek third party vendors)

HTH, Jens Suessmeyer.

No comments:

Post a Comment