Goal:
I want to retrieve the value of [data].[Mobiles]
when you use a query document that is for the database [test]
(use [test]
)
目标:我想在使用数据库[test]的查询文档时检索[data]。[Mobiles]的值(使用[test])
Problem:
Based on picture two, I cannot retrieve the value from the database. Don't know what is the problem? The database [wwtest]
is existing.
问题:基于图片2,我无法从数据库中检索值。不知道是什么问题?数据库[wwtest]已存在。
Picture 1:
Picture 2:
1 个解决方案
#1
1
That's because in your second picture you are using a 4-part name, which means:
那是因为在你的第二张照片中你使用了一个由4部分组成的名字,这意味着:
server . database . schema . object
服务器。数据库。架构。宾语
So the query will fail because you don't have a wwtest
server.
因此,查询将失败,因为您没有wwtest服务器。
Assuming [data]
is your schema name, you just need to change your query to:
假设[data]是您的架构名称,您只需将查询更改为:
use [test]
select *
from [wwtest].[data].[Mobiles]
and this will be recognized as:
这将被认为是:
database . schema . object
数据库。架构。宾语
More info: Transact-SQL Syntax Conventions (Transact-SQL)
更多信息:Transact-SQL语法约定(Transact-SQL)
#1
1
That's because in your second picture you are using a 4-part name, which means:
那是因为在你的第二张照片中你使用了一个由4部分组成的名字,这意味着:
server . database . schema . object
服务器。数据库。架构。宾语
So the query will fail because you don't have a wwtest
server.
因此,查询将失败,因为您没有wwtest服务器。
Assuming [data]
is your schema name, you just need to change your query to:
假设[data]是您的架构名称,您只需将查询更改为:
use [test]
select *
from [wwtest].[data].[Mobiles]
and this will be recognized as:
这将被认为是:
database . schema . object
数据库。架构。宾语
More info: Transact-SQL Syntax Conventions (Transact-SQL)
更多信息:Transact-SQL语法约定(Transact-SQL)