Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
when i fire below query ,then display error message
give simple select query .....


SQL
Select no, name
from tb1
where name='rahul' ;




Msg 208, Level 16, State 1, Line 3
Invalid object name 'tb1'.

pls give me solution...
Posted
Updated 9-Feb-11 20:47pm
v2

Select Query[^] just have a glance this will help you.
 
Share this answer
 
Comments
somil030 10-Feb-11 2:53am    
By using suggest query inside link error msg display,table emp1 already in my database.
Msg 208, Level 16, State 1, Line 2
Invalid object name 'emp1'.
The error that you have mentioned "Invalid object name 'tb1'" simply says that the table tb1 is not there in the database. Please make sure that you have table tb1 already created.

Hope this helps.
All the best.
 
Share this answer
 
Comments
somil030 10-Feb-11 2:46am    
table tb1 already there pls suggest simple select query in sql2005
Your Error Means that table does not exist in the Current Schema
Verify your schema , that is connected is correct or not.

example :

SQL
Select no, name
from <schema>.dbo.tb1
where name='rahul' ;</schema>
 
Share this answer
 
Comments
somil030 10-Feb-11 2:58am    
how do i verify schema?
Just try the following.

Creates a new table into your database
SQL
create table testTable
(testName varchar(50),testAddress varchar(50))


Inserts values
SQL
insert into testtable(testname,testaddress) values('Myname','Address')


Gets the values from column testname
select testname from testtable
 
Share this answer
 
Comments
somil030 10-Feb-11 4:09am    
using given example teble created successfully but insert query does not work and display following msg ...
Msg 208, Level 16, State 1, Line 1
Invalid object name 'testTable'.
m@dhu 10-Feb-11 4:18am    
I think you are using different database in which the table isn't present so the error comes Now check 'YourDataBaseName' should be same in which you created the table.
USE [YourDataBaseName]
GO
insert into testtable(testname,testaddress) values('Myname','Address')

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900