Solved

Invalid Column Name

Posted on 1998-12-11
5
268 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
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Performance is the key factor for any successful data integration project, knowing the type of transformation that you’re using is the first step on optimizing the SSIS flow performance, by utilizing the correct transformation or the design alternat…
I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

747 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

11 Experts available now in Live!

Get 1:1 Help Now