Solved

Invalid Column Name

Posted on 1998-12-11
5
274 Views
Last Modified: 2012-05-04
If anyone have an idea...

When I try to  UPDATE  the column TipoAyuda of the table AyudaEcon I receive the message 'Invalid Column Name CodAyudaEcon' wich is the primary key.  I can't INSERT rows neither.
However, if I do the following:

SELECT CodAyudaEcon
   FROM AyudaEcon
WHERE CodAyudaEcon = '0001'

I receive the expected results.

I  can also select the column name from the Sysobjects table of the database.


What can be happening on this table?

0
Comment
Question by:gpolanco
[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
5 Comments
 

Expert Comment

by:cards
ID: 1092243
Tables default the owners as SA unless someone else creates the table.  If the table belong to a different owner then, while running a query you have to include the owners name in the query. Only time you do not is when the owner is SA. Look at the table and see who owns the table. It will be in parentheses by the table name. Books online show the correct syntax for this query. (dbo) is the SA tables.
0
 

Author Comment

by:gpolanco
ID: 1092244
Hi Cards, I'm sorry to say that  what you adviced to do was the first thing I did.

For future advices to this strange error, would help to know that I'm not a beginner using SQL-SERVER.  I decided to post this questions because what is happening is very strange and I can't think what held is happening.

0
 
LVL 3

Expert Comment

by:Stefaan
ID: 1092245
Hi gpolanco,

I just wanted to make sure.  Do you have the necessary permissions on the Table, or even on that specific field ?

0
 

Accepted Solution

by:
rayasam earned 100 total points
ID: 1092246
There might be corruption with some tables in the database. Please do a DBCC CHECKDB followed by a DBCC NEWALLOC on the database which contains these tables. Look for any errors in the results. If you have a large database the DBCC CHECKDB might take quite sometime,in which case I would suggest using the DBCC CHECKTABLE(AyudaEcon) first. If you don't find any errors then go ahead with dbcc checkdb and dbcc newalloc as mentioned earlier.

(PS: I'm assuming that you have all required permissions on the target table and columns. )
0
 

Author Comment

by:gpolanco
ID: 1092247
Hi rayasam, thanks for your proposed answer.  I had urgency about solving the porblem in that table and I decided to drop and to recreate it before I received your proprosed answer. It obviously solve the problem.  

Before drop it, I did a DBCC CHECKDB and it didn't report any errors. I didn't do any DBCC NEWALLOC, thus I don't know if it would solve it.

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

696 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