Showing posts with label spaces. Show all posts
Showing posts with label spaces. Show all posts

Wednesday, March 7, 2012

how can i use The "Use Database" statement >>>

the question is how to use use database statement if

the name of the database contain spaces

??

please help me

Thanks

CREATE DATABASE [I SHALL NOT USE BLANKS IN ANY OBJECT NAME]
GO
USE [I SHALL NOT USE BLANKS IN ANY OBJECT NAME]
SELECT * FROM
INFORMATION_SCHEMA.TABLES
USE Master
GO
DROP DATABASE [I SHALL NOT USE BLANKS IN ANY OBJECT NAME]
--
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de|||

Frank Kalis wrote:

CREATE DATABASE [I SHALL NOT USE BLANKS IN ANY OBJECT NAME]
GO
USE [I SHALL NOT USE BLANKS IN ANY OBJECT NAME]
SELECT * FROM
INFORMATION_SCHEMA.TABLES
USE Master
GO
DROP DATABASE [I SHALL NOT USE BLANKS IN ANY OBJECT NAME]
--
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de

thats too funny! I picture bart writing that on the blackboard in a future episode of The Simpsons

|||Unfortunately you can't add images here in the fora, but I believe you mean this one
http://www.insidesql.de/images/stories/google_bart.gif

But I think, this one's also pretty cool
http://www.insidesql.de/images/6thsense.jpg
--
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de|||

why all this my friend ?!!

don't exaggerate

i'm tried to write the following statement before :

Insert Into [My DB].MyTable(No) values 6

and the compiler refuse the statement ..

so i send for help

|||

Insert Into [My DB].MyTable(No) values (6)

|||If I offended you, please accept my apologies!
My links were intended only to be fun, nothing more. They are neither related to you nor your question.
--
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de

how can i use The "Use Database" statement >>>

the question is how to use use database statement if

the name of the database contain spaces

??

please help me

Thanks

CREATE DATABASE [I SHALL NOT USE BLANKS IN ANY OBJECT NAME]
GO
USE [I SHALL NOT USE BLANKS IN ANY OBJECT NAME]
SELECT * FROM
INFORMATION_SCHEMA.TABLES
USE Master
GO
DROP DATABASE [I SHALL NOT USE BLANKS IN ANY OBJECT NAME]
--
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de
|||

Frank Kalis wrote:

CREATE DATABASE [I SHALL NOT USE BLANKS IN ANY OBJECT NAME]
GO
USE [I SHALL NOT USE BLANKS IN ANY OBJECT NAME]
SELECT * FROM
INFORMATION_SCHEMA.TABLES
USE Master
GO
DROP DATABASE [I SHALL NOT USE BLANKS IN ANY OBJECT NAME]
--
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de

thats too funny! I picture bart writing that on the blackboard in a future episode of The Simpsons

|||Unfortunately you can't add images here in the fora, but I believe you mean this one
http://www.insidesql.de/images/stories/google_bart.gif

But I think, this one's also pretty cool
http://www.insidesql.de/images/6thsense.jpg
--
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de
|||

why all this my friend ?!!

don't exaggerate

i'm tried to write the following statement before :

Insert Into [My DB].MyTable(No) values 6

and the compiler refuse the statement ..

so i send for help

|||

Insert Into [My DB].MyTable(No) values (6)

|||If I offended you, please accept my apologies!
My links were intended only to be fun, nothing more. They are neither related to you nor your question.
--
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de

how can i use The "Use Database" statement

the question is how to use use database statement if

the name of the database contain spaces

??

please help me

Thanks

CREATE DATABASE [I SHALL NOT USE BLANKS IN ANY OBJECT NAME]
GO
USE [I SHALL NOT USE BLANKS IN ANY OBJECT NAME]
SELECT * FROM
INFORMATION_SCHEMA.TABLES
USE Master
GO
DROP DATABASE [I SHALL NOT USE BLANKS IN ANY OBJECT NAME]
--
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de
|||

Frank Kalis wrote:

CREATE DATABASE [I SHALL NOT USE BLANKS IN ANY OBJECT NAME]
GO
USE [I SHALL NOT USE BLANKS IN ANY OBJECT NAME]
SELECT * FROM
INFORMATION_SCHEMA.TABLES
USE Master
GO
DROP DATABASE [I SHALL NOT USE BLANKS IN ANY OBJECT NAME]
--
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de

thats too funny! I picture bart writing that on the blackboard in a future episode of The Simpsons

|||Unfortunately you can't add images here in the fora, but I believe you mean this one
http://www.insidesql.de/images/stories/google_bart.gif

But I think, this one's also pretty cool
http://www.insidesql.de/images/6thsense.jpg
--
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de
|||

why all this my friend ?!!

don't exaggerate

i'm tried to write the following statement before :

Insert Into [My DB].MyTable(No) values 6

and the compiler refuse the statement ..

so i send for help

|||

Insert Into [My DB].MyTable(No) values (6)

|||If I offended you, please accept my apologies!
My links were intended only to be fun, nothing more. They are neither related to you nor your question.
--
Frank Kalis
Microsoft SQL Server MVP
http://www.insidesql.de

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.