sql server 2005 的简单问题,菜鸟提问???

来源:百度知道 编辑:UC知道 时间:2024/05/12 13:04:51
问个菜鸟级问题:
服装销售数据库是我建立的数据库,clothTable 是这个库中的表格。

select * from [服装销售数据库].clothTable 就出错,改成

select * from clothTable 就正确,为什么??要想写成前一种方式,我该怎么写?

select * from [服装销售数据库].dbo.clothTable

根据数据库查询表不是你那样写的,一般数据库选定后可以直接写查询语句 就像你的select * from clothTable。。

要是数据库没有选定你可以这样写:
use 服装销售数据库
select * from clothTable