BULK INSERT无法在预定作业中工作

时间:2015-08-05 15:16:27

标签: sql-server-2012 job-scheduling

我已经编写了附件查询。它在Job之外运行良好,但在工作中,我收到错误。我已经删除了查询的BULK INSERT部分,它运行正常。为什么不能在工作中运行? 有人可以帮忙吗?

由于

格里

/* Import Accellos Data */

CREATE TABLE [METRICS].[dbo].[TempImportFromSource]
([COUNTDATE][datetime] NOT NULL,
[IDWHSE][varchar](10) NOT NULL,
[IDLOCATION][varchar](50) NOT NULL,
[IDCUST] [varchar](10) NOT NULL,)
BULK INSERT [METRICS].[dbo].[TempImportFromSource]
from 'C:\SQLDATA\OracleDump\DelfourDaily.csv'
with (FIELDTERMINATOR = ',', ROWTERMINATOR = '\n', firstrow = 2)



INSERT INTO [METRICS].[dbo].[StorageUsageRaw] 
select COUNTDATE, 
        YEAR(GETDATE()) AS COUNTYEAR,
        MONTH(GETDATE()) AS COUNTMONTH ,
        DAY(CONVERT(date,DATEADD(dd, 0, GETDATE()))) AS COUNTDAY, 
        IDWHSE, IDLOCATION, IDCUST
FROM [METRICS].[dbo].[TempImportFromSource]

DROP TABLE [METRICS].[DBO].[TempImportFromSource]

0 个答案:

没有答案