INSERT INTO dbo.person_give_deduct
(give_id,deduct_year,deduct_month,person_no,deduct_date,give_deduct_no,name,
give_money,deduct_money,other_give_money,other_deduct_money,
remark,person_no1,person_name1,position1,date1,remark1,enable,status,history)
SELECT give_id=id,deduct_year,deduct_month,person_no,deduct_date,give_deduct_no,name,
give_money,deduct_money,
other_give_money=CASE WHEN other_give_money=0 THEN NULL ELSE other_give_money END,
other_deduct_money=CASE WHEN other_deduct_money=0 THEN NULL ELSE other_deduct_money END,
remark,person_no1=24115,person_name1='黃東海',position1='資訊組技士',date1=getdate(),remark1='批量導入',enable='1',status='A',history='A'
FROM OPENDATASOURCE('sqloledb','data source=服務器名;user id=用戶名;password=12345678').hdh.dbo.tabGiveDeduct1