Link to home
Start Free TrialLog in
Avatar of johnson1
johnson1

asked on

invalid object name

Hello,
I get this error: Invalid object name: 'dbo.temp_ETS'.

At the beginning of my stored procedure I have

IF OBJECT_ID('dbo.temp_ETS') IS NOT NULL
DROP TABLE dbo.temp_ETS

I also have the same at the end of the query.

Do you know why this happens?
Avatar of Haris Dulic
Haris Dulic
Flag of Austria image

Hello,

there are few possibilities for this error:

1. Is there a table temp_ETS?
2. Is it in the dbo schema?
3. is the database case sensitive? i.e. maybe there is typo in the table name?

In order to test number 1 can you run this query:
select top 1 * from temp_ETS?

Open in new window

Avatar of johnson1
johnson1

ASKER

I tried both temp_ETS and dbo.temp_ETS and I got the error Invalid object name
This  basically means that there is no table. Are you connected to proper database?
yes
ASKER CERTIFIED SOLUTION
Avatar of Haris Dulic
Haris Dulic
Flag of Austria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I had drop table after select statement in the query. When I removed it then it did work.