Have a very strange problem when trying to rename table and use it.
I have a table called oldTable and rename it to the newTable.
I can successfully use select on this table using:
SELECT * FROM database.dbo.newTable;
But when I try to use update like this:
UPDATE database.dbo.newTable SET foo = bar where id = 1;
I receive following error:
Msg 208, Level 16, State 1, Procedure archive, Line 4 [Batch Start Line 0]
Invalid object name 'oldTable'.
Looks like name oldTable was stored somewhere and is used here by some kind of reference. It happens on both ssms and raw php+sql when trying to update.
Anyone have any idea?
Renaming a table will not update any Triggers that have been defined for the table (or any references to it anywhere else) so you need to manually update any triggers or other dependencies to reflect the new name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With