SQL Server 2012中查询中的Ip地址“语法不正确”

时间:2021-03-14 22:47:19

I have tried create new view using an IP address in the query syntax. But this resulted in an error.

我尝试在查询语法中使用IP地址创建新视图。但这导致了错误。

Query in View Editor: SQL Server 2012中查询中的Ip地址“语法不正确”

在视图编辑器中查询:

SELECT *
FROM IP-ADDRESS.DATABASE.dbo.TABLE

Error:

SQL Server 2012中查询中的Ip地址“语法不正确”

In Normal Query (Work it): SQL Server 2012中查询中的Ip地址“语法不正确”

在普通查询中(工作):

How may I correctly execute this query?

我该如何正确执行此查询?

Thank!

1 个解决方案

#1


2  

Try using tsql instead of the UI. I tested in the UI and I see what you mean that it is not keeping brackets.

尝试使用tsql而不是UI。我在UI中测试过,我看到你的意思是它没有保留括号。

CREATE VIEW [YourViewName]
AS

SELECT 
  *
FROM [IP-ADDRESS].DATABASE.dbo.TABLE
WHERE Something

#1


2  

Try using tsql instead of the UI. I tested in the UI and I see what you mean that it is not keeping brackets.

尝试使用tsql而不是UI。我在UI中测试过,我看到你的意思是它没有保留括号。

CREATE VIEW [YourViewName]
AS

SELECT 
  *
FROM [IP-ADDRESS].DATABASE.dbo.TABLE
WHERE Something