SQLServer同步Execl到数据库(Integration Services)
1.使用VS2019扩展,下载安装【Microsoft.DataTools.IntegrationServices】
注:这里可能需要VPN,不然好像很慢的样子
2.安装完成后设计
3.生成【Global_LobSegment.dtsx】文件放到目录:【D:\MiniPulseV2.0SSIS\Server】
4.执行sql
DECLARE @returncode int,@Cmd varchar(2000) DECLARE @File varchar(500) = 'Global_LobSegment.dtsx' --SET @Cmd ='"c:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\dtexec.exe"' + ' /De 123 /f D:\MiniPulseV2.0SSIS\Server\' + @File SET @Cmd ='"D:\Microsoft SQL Server(x86)\150\DTS\Binn\dtexec.exe"' + ' /De 123 /f D:\MiniPulseV2.0SSIS\Server\' + @File EXEC @returncode = xp_cmdshell @Cmd
注:期间可能出现错误
可能需要开启服务
EXEC sp_configure 'show advanced options', 1 RECONFIGURE EXEC sp_configure 'xp_cmdshell', 1 RECONFIGURE
参阅:https://blog.csdn.net/eldn__/article/details/8248339
https://blog.csdn.net/weixin_34223655/article/details/91495684