CREATE TABLE new_table
(
i_id int NOT NULL IDENTITY (1, 1),
...
)
go
SET IDENTITY_INSERT new_table ON
go
INTO new_table SELECT * FROM old_table
go
SET IDENTITY_INSERT new_table OFF
go
DROP TABLE old_table
go
EXEC sp_rename 'new_table','old_table'
阅读(1651) | 评论(0) | 转发(0) |