I read in SQL Server documentation that I can specify column names in FROM clause of a simple SELECT query. But when I try to run this query:
select * from my_db.dbo.test_table.test;
I get the following error:
Msg 7202, Level 11, State 2, Line 1 Could not find server 'my_db' in sys.servers. Verify that the correct server name was specified. If necessary, execute the stored procedure sp_addlinkedserver to add the server to sys.servers.
I know this is a T-SQL page, and I'm trying to run .
Why does this happen?
I'm using SQL Server version 2017 via Microsoft SQL Server Management Studio version 2017 as well.
try rewriting from this
to this
the way it was written with that many Periods it assume you are trying to fully qualify the table so in what you had tried to the server is treating it as follows
the fields you want to show should directly follow the Keyword Select so if you only wanted 2 fields you could write
or simpler if you only have the one server
or if you only have the defailt Schema dbo (Database Base Owner)
I hope thaelps