sp_rename [ @objname = ] 'object_name' , [ @newname = ] 'new_name'
[ , [ @objtype = ] 'object_type' ]
用法,如果数据库中存在Liver_Items_Parts表,将它重新命名为Old_Liver_Items_Parts]
if exists(select * from sysobjects where id = OBJECT_ID(N'[dbo].[Liver_Items_Parts]')and OBJECTPROPERTY(id,N'IsUserTable')=1)exec sp_rename 'Liver_Items_Parts' ,'Old_Liver_Items_Parts';