Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

invalid object name

Posted on 2014-10-04
6
108 Views
Last Modified: 2014-10-04
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?
0
Comment
Question by:johnson1
  • 3
  • 3
6 Comments
 
LVL 15

Expert Comment

by:Haris Djulic
ID: 40361317
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

0
 

Author Comment

by:johnson1
ID: 40361332
I tried both temp_ETS and dbo.temp_ETS and I got the error Invalid object name
0
 
LVL 15

Expert Comment

by:Haris Djulic
ID: 40361336
This  basically means that there is no table. Are you connected to proper database?
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 

Author Comment

by:johnson1
ID: 40361355
yes
0
 
LVL 15

Accepted Solution

by:
Haris Djulic earned 500 total points
ID: 40361359
Can you browse database and confirm that the table is there?

 Can you try to create the new table with same name?
0
 

Author Closing Comment

by:johnson1
ID: 40361364
I had drop table after select statement in the query. When I removed it then it did work.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is basically a blog post I wrote recently. I've found that SARGability is poorly understood, and since many people don't read blogs, I figured I'd post it here as an article. SARGable is an adjective in SQL that means that an item can be fou…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question