USE ESPATruncate table dbo.Interface_Customer--Delete the table data but retain the structureexec sp_configure "show advanced options",1reconfiguregoexec sp_configure "Ad Hoc Distributed Queries",1reconfigure go--Open peripheral component and service related to data imput and exportINSERT INTO Interface_Customer (Cust_Code,Cust_Name, Src_Sys_Code,Currency,Customer_group) SELECT Cust_Code,[Cust_Name ( Chinese)],Src_Sys_Code,Currency,[Customer group]from OPENDATASOURCE ('Microsoft.ACE.OLEDB.12.0','Data Source="E:\eSPA_database\eSpa2_Test_data-Product.xls";Extended properties=Excel 8.0')...sheet1$--Insert data from excel to database exec sp_configure "Ad Hoc Distributed Queries",0reconfiguregoexec sp_configure "show advanced options",0reconfigurego
贴在这里,图个方便