We just changed the name of the view and the metadata has not been updated yet. This indicates an error in SSMS, in this particular case about an invalid object name, but it’s not: I can’t help but notice the name of the view underlined in red. We could have just dropped the view and use the CREATE VIEW SQL statement to re-create it with the new definition, but we can’t break script and dependencies with this simple view, so it’s safe to just rename it using the stored procedure. The example below changes the database context to the SQLShackDB database and changes the view’s name: Make sure that you’re are connected to the SQLShackDB database or specify the database name in the USE statement to avoid getting errors from SQL Server. This is a series about using T-SQL, so we’re going to do it using the stored procedure mentioned above.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |