是的,导表是有这种特性.要达到你的要求,看看这个吧
BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_te
(
id int NOT NULL IDENTITY (1, 1)
) ON [PRIMARY]
GO
SET IDENTITY_INSERT dbo.Tmp_te ON
GO
IF EXISTS(SELECT * FROM dbo.te)
EXEC('INSERT INTO dbo.Tmp_te (id)
SELECT id FROM dbo.te TABLOCKX')
GO
SET IDENTITY_INSERT dbo.Tmp_te OFF
GO
DROP TABLE dbo.te
GO
EXECUTE sp_rename N'dbo.Tmp_te', N'te', 'OBJECT'
GO
COMMIT
以上是我的一个表te,只有一列id,修改为自动列的过程,实际上不存在修改,而是新建一张一样的表,再把数据导过来,你可以看看,改成在导数据的时候就可以直接导ID列了