Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Invalid column

Author  Topic 

danasegarane76
Posting Yak Master

242 Posts

Posted - 2007-04-04 : 07:04:35
Dear All,
I attached my old Database to SQL 2005.After attaching the db
I tried this query in query analyzer "
"select * from emp_table"

and I am getting the error msg as Invalid columname
But both the table and column exit the table

What could be the wrong

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-04-04 : 07:12:48
How can executing "select * from emp_table" give invalid column name error as column name is not specified?



Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-04-04 : 07:13:06
Make sure you are firing the query in desired database.

Firstly check whether desired table exists:

Select * from information_schema.tables where table_name = 'emp_table' and table_type = 'base table'


Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

danasegarane76
Posting Yak Master

242 Posts

Posted - 2007-04-04 : 07:25:27
It is now running in query analyser.But I run from the Vb it is giviving the error message.Could it be because of user rights
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-04-04 : 07:28:29
Could be a permission issue if your VB application is not using the same login credentials as those you use to login to Query Analyzer.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page
   

- Advertisement -