如何在SQL Server中重命名表(How to rename a table in SQL Server)Thesp_renameis a stored procedu...
Always use the latest version of SQL Server Management Studio (SSMS).Rename a tableIn Object Explorer, right-click the table you want to rename and choose Design from the shortcut menu. From the View menu, choose Properties. In the field for the Name value in the Properties window, type ...
The sp_rename is a stored procedure which helps to rename tables in SQL Server and the usage syntax will be like the below: sp_rename是一个存储过程,可帮助重命名SQL Server中的表,用法语法如下所示: sp_rename 'old_table_name', 'new_table_name' The result outputs of this procedure might b...
SQL 複製 USE AdventureWorks2022; GO -- Return the current Primary Key, Foreign Key and Check constraints for the Employee table. SELECT name, SCHEMA_NAME(schema_id) AS schema_name, type_desc FROM sys.objects WHERE parent_object_id = (OBJECT_ID('HumanResources.Employee')) AND type IN ...
如果要重命名的对象是表中的列object_name必须在窗体table.column或schema.table.column中使用。如果要重命名的对象的索引object_name必须在窗体table.index或schema.table.index。如果要重命名的对象是一个约束object_name必须在窗体schema.constraint。 -- item type determined?
Renames a user-created table, a column in a user-created table or database in Analytics Platform System (PDW). This article applies to Azure Synapse Analytics and Analytics Platform System (PDW) only: To rename a database in SQL Server, use the stored procedure sp_renamedb. To rename a ...
SQL -- Rename the customer tableRENAMEOBJECTCustomerTOCustomer1;RENAMEOBJECTmydb.dbo.CustomerTOCustomer1; 重命名表时,与表关联的所有对象和属性都会进行更新以引用新表名。 例如,表定义、索引、约束和权限会进行更新。 视图不会更新。 C. 将表移动到另一个架构 ...
Always use the latest version ofSQL Server Management Studio (SSMS). Rename a table InObject Explorer, right-click the table you want to rename and chooseDesignfrom the shortcut menu. From theViewmenu, chooseProperties. In the field for theNamevalue in thePropertieswindow, type a new name ...
syntaxsql sp_rename[ @objname = ]'object_name', [ @newname = ]'new_name'[ , [ @objtype = ]'OBJECT'] Arguments [@objname= ] 'object_name' The current qualified or nonqualified name of the user object or data type. If the object to be renamed is a column in a table,object_...
There is an example dataBase in which we have some tables. The word "Account" is included in the names of 5 tables in that database. For example we have: Table1: FactAccount Table2: FactAccountBalance Table3: DimAccountTime "Account" is also included in the name of some of the col...