Use SQL Server Management Studio Rename a column using Object Explorer Refresh the metadata using sp_refreshsqlmodule or sp_refreshview. For example, if you rename a table column and that column is referenced by a non-schema-bound view or function that SELECTs all columns (using the *), the metadata for the view or function continues to reflect the original column name. Renaming a column doesn't automatically update the metadata for any objects which SELECT all columns (using the *) from that table. Use sys.sql_expression_dependencies to list dependencies on the object before renaming it. For example, if you rename a table column and that column is referenced in a trigger, you must modify the trigger to reflect the new column name. You must modify any objects that reference the renamed column manually. ![]() ![]() Renaming a column won't automatically rename references to that column. You can rename a table column in SQL Server by using SQL Server Management Studio or Transact-SQL.
0 Comments
Leave a Reply. |