About sql table name

About sql table name

Post by dvado » Sat, 12 Jan 2002 21:40:26



can i use "." as part of the table name?

(sql server 2000/ windows 2000 server)

in QA:

creat table [dbo].[test.test](Number int PRIMARY KEY identity,title
nvarchar(32) DEFAULT('TITLE'))"

this command can execute successfuly

but when i using this command

sp_help [test.test]

who can tell me why?

thx
--

 
 
 

About sql table name

Post by Lasse Edsvi » Sat, 12 Jan 2002 22:26:48


dvador,

no, you can't use "." in a tablename

/Lasse


> can i use "." as part of the table name?

> (sql server 2000/ windows 2000 server)

> in QA:

> creat table [dbo].[test.test](Number int PRIMARY KEY identity,title
> nvarchar(32) DEFAULT('TITLE'))"

> this command can execute successfuly

> but when i using this command

> sp_help [test.test]

> who can tell me why?

> thx
> --



 
 
 

About sql table name

Post by Aaron Bertrand [MVP » Sat, 12 Jan 2002 22:36:49


Quote:> no, you can't use "." in a tablename

You can, but you shouldn't.

www.aspfaq.com

 
 
 

About sql table name

Post by Aaron Bertrand [MVP » Sat, 12 Jan 2002 22:37:15


Just like in the create statement, you need to put brackets around the table
name, so that the sp doesn't interpret the 'test' before the . as an owner
name.

EXEC sp_help '[test.test]'

www.aspfaq.com


> can i use "." as part of the table name?

> (sql server 2000/ windows 2000 server)

> in QA:

> creat table [dbo].[test.test](Number int PRIMARY KEY identity,title
> nvarchar(32) DEFAULT('TITLE'))"

> this command can execute successfuly

> but when i using this command

> sp_help [test.test]

> who can tell me why?

> thx
> --


 
 
 

About sql table name

Post by Lasse Edsvi » Sat, 12 Jan 2002 23:02:17


Aaron,

that's the same thing isn't it? :)

/Lasse



Quote:> > no, you can't use "." in a tablename

> You can, but you shouldn't.

> www.aspfaq.com

 
 
 

About sql table name

Post by Aaron Bertrand [MVP » Sat, 12 Jan 2002 23:08:40


Quote:> that's the same thing isn't it? :)

Not in here it's not...

www.aspfaq.com

 
 
 

About sql table name

Post by dvado » Sun, 13 Jan 2002 11:27:50


i have tried your method, it's function.

--
"Aaron Bertrand [MVP]" <aaronATaspfaq.com> wroted:

Quote:> Just like in the create statement, you need to put brackets around the
table
> name, so that the sp doesn't interpret the 'test' before the . as an owner
> name.

> EXEC sp_help '[test.test]'

> www.aspfaq.com

 
 
 

About sql table name

Post by dvado » Sun, 13 Jan 2002 11:30:56


I know shouldn't, but i have to :(

"Aaron Bertrand [MVP]" <aaronATaspfaq.com> wroted

Quote:> > no, you can't use "." in a tablename

> You can, but you shouldn't.

> www.aspfaq.com