I like the new CREATE OR REPLACE clause for views, procedures and the like introduced with SA 11.0.1. My thought was that in case of an already existing object, the behaviour would be identical to an ALTER statement.
I just found out that this seems not to be the case:
Whereas an ALTER VIEW will leave the table_id and object_id (and the creation_time in SYSOBJECT) unchanged, a replaced view gets new values there. So a CREATE OR REPLACE seems to be a DROP statement combined with a CREATE statement and regenerated permissions.
Of course, the difference is somewhat marginal; however, I thought CREATE OR REPLACE would be a handy substitute to the following common script construct:
Is this difference by design? And are there other slight differences between CREATE OR REPLACE and ALTER with respect to existing objects?