Solved

invalid object name

Posted on 2014-10-04
6
106 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
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.

 

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

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!

Question has a verified solution.

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

Suggested Solutions

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…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Edureka is one of the fastest growing and most effective online learning sites.  We are here to help you succeed.

912 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now