?
Solved

invalid object name

Posted on 2014-10-04
6
Medium Priority
?
115 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
[X]
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
  • 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

Author Comment

by:johnson1
ID: 40361355
yes
0
 
LVL 15

Accepted Solution

by:
Haris Djulic earned 2000 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

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.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

800 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