I tracked down a bug in my system to this anomaly - at least it's an anomaly in my system of 15 catalogs with similar but unequal schemas.
What causes the [TABLE_NAME] in [INFORMATION_SCHEMA].[VIEWS] to be different than the value in [VIEW_DEFINITION]?
It makes me think I don't understand something about Views or System Tables in SQL Server... .
If you have renamed the view, the name changes, but the definition doesn't.
You should do this as a
DROP
/CREATE
or anALTER
script, not by right-clicking or usingsp_rename
.This is actually expected behavior for all modules. Here is a quick test using a simple stored procedure:
Results:
In any case, you shouldn't be using
INFORMATION_SCHEMA
anyway...