May 22, 2020 at 2:34 am
I am testing on the AdventureWorks database (the OLTP version, not the data warehouse version). This version has the 'dbo' schema and other schemas to. I am trying to run a simply query and I get an error stating invalid object name 'HumanResources.Employee.BusinessEntityID'. Here is the code:
SELECT *
FROM [HumanResources].[Employee].BusinessEntityID;
This doesn't work either:
SELECT *
FROM [Employee].BusinessEntityID;
When I run this code, I get a result set:
SELECT *
FROM [HumanResources].[Employee];
I am in the AdventureWorks2017 database.
May 22, 2020 at 2:43 am
Nevermind. I see what I did wrong. Only the schema and table should be in the FROM clause. The column names should be in the SELECT statement.
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy