sql字段如果需要修改,修改后添加重命名的话,应该如何实现呢?下面就教您sql字段修改并添加重命名的方法,希望对你学习sql字段方面有所帮助。
- alter table dbo.JiuHuo_User add ss varchar(50)
- alter table JiuHuo_User alter column ss ss1 varchar(50)
- exec sp_rename 'JiuHuo_User','ss','ss1','column'
- exec sp_rename 'JiuHuo_User.ss','addr'
- alter table JiuHuo_User alter column addr int
- alter table JiuHuo_User drop column addr
- exec sp_rename 'JiuHuo_User','JiuHuo_User'
- alter table JiuHuo_User sp_rename JiuHuo_User1
- alter table dbo.JiuHuo_User add sss int IDENTITY(100000,1)
- alter table JiuHuo_User alter column ss int IDENTITY(1,1)
- select * from [user]
- update [user] set city='000000000000'
【编辑推荐】