Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Invalid Column Name

Posted on 1998-12-11
5
Medium Priority
?
276 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 200 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

636 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