例如有表A中有字段id,material,material_type
表B中有字段id,product,product_type
用语句
INSERT INTO A ([id],material,material_type)
SELECT [id],product,product_type FROM B
就OK了
--建立測試環境
Create Table A (ID Int Primary Key, Name Varchar(10))
GO
--測試
Declare @I Int
Set @I=1
While @I<100
Begin
Insert A Select @I,'A'
Set @I=@I+1
End
GO
Select * from A
--刪除測試環境
Drop Table A