insert into select用法

 

insert into T_CUST_CUSTINFO_13(
		[ID]
      ,[ROWID]
      ,[CREATEDATE]
      ,[CREATOR]
      ,[UPDATEDATE]
      ,[UPDATOR]
      ,[A606]
      ,[A607]
      ,[A608]
      ,[A609]
      ,[A610]
      ,[A619]
      ,[A620]
      ,[A621]
      ,[A627]
)
select [ID]
      ,[ROWID]
      ,[CREATEDATE]
      ,[CREATOR]
      ,[UPDATEDATE]
      ,[UPDATOR]
      ,[A606]
      ,[A607]
      ,[A608]
      ,[A609]
      ,[A610]
      ,[A619]
      ,[A620]
      ,[A621]
      ,[A627]
      from T_CUST_CUSTINFO_12

 如上,只要列对应即可。

如果遇到ID是自增量,要set IDENTITY_INSERT tableName on才行。

你可能感兴趣的:(insert into select用法)