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 2000 Forums
 SQL Server Development (2000)
 renaming columns

Author  Topic 

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2002-02-07 : 19:30:22
Hi all

I just experienced a problem which I did not expect. I attempted to rename a column in a table. I also updated an sp which inserted into the table with the new column name, however after updating it, it would fail with some message or other about "trigPO" - basically intimating that I had the wrong column name.

I have no triggers - and certainly nothing named trigPO - so I was a bit confused. I eventually had to drop the table, rebuild it with the new column name and re-insert the data before my sp would work again.

Can anyone enlighten me as to what was going on? (SQL 2000)

--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"

byrmol
Shed Building SQL Farmer

1591 Posts

Posted - 2002-02-07 : 19:49:54
rrb,

Need more info mate....


DavidM

Tomorrow is the same day as Today was the day before.
Go to Top of Page

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2002-02-07 : 19:56:38
quote:

Need more info mate....



unfortunately so do I. That's about all I've got though - the error message was the same as if my stored procedure just had the wrong column name. I'd even dropped the sp and recreated it and got the same error. I could query the table (with the new column name) ok - but if i tried to do "delete from A" it would fail again with the same message.

Basically any action on A was failing with a message intimating that column 'oldcolumnname' could not be found in that table. I even exported the script for the table and checked that the column name was right.

No major problem because I dropped the table, ran the script again, re-inserted the data into the table - but I am curious as to what the hey happened.

Sorry I can't be more clear.

--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"
Go to Top of Page

byrmol
Shed Building SQL Farmer

1591 Posts

Posted - 2002-02-07 : 20:04:29
Is sounds like the catalog information for that table was not updated correctly....

I would have loved to see the sysobjects and syscolumns results....

I will have a bit of a play...

DavidM

Tomorrow is the same day as Today was the day before.
Go to Top of Page

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2002-02-09 : 07:38:34
quote:

DavidM



I can probably re-create the problem for you during some planned down-time for my site - but I will need to correct it quickly. What would you like to see?

--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"
Go to Top of Page
   

- Advertisement -