日期:2014-05-18 浏览次数:20508 次
USE [人保] GO /****** Object: StoredProcedure [dbo].[SJ_JF_JGYL_DW] Script Date: 02/24/2012 22:07:55 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: <Author,,Name> -- Create date: <Create Date,,> -- Description: <Description,,> -- ============================================= ALTER PROCEDURE [dbo].[SJ_JF_JGYL_DW] @FileName char(500)='N:\__SJ_JF_JGYL_DW2005-2011单位应缴实缴明细2.xls' AS BEGIN --sj_zf_xnh declare @s nvarchar(max) -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Insert statements for procedure here --truncate table SJ_DB_FFMX set @s='SELECT XZDM,XZQHDM,TCQDM,DWBH,FKSSQ,DZRQ_DW,ZJFS,JFLX,JFJE_DW_YJ,JFJE_DW_SJ,JFJE_DWHGR,JFJS_DW,JFBL_DW,JFRS_YJ,JFRS_SJ,DZBZ_DW ' set @s=@s+' FROM OpenDataSource( ''Microsoft.Jet.OLEDB.4.0'',' set @s=@s+'''Data Source='+@FileName+';User ID=Admin;Password=;Extended properties=Excel 5.0'') ...[cnm$]' execute(@s) set @s='insert __SJ_JF_JGYL_DW '+@s execute(@s) END