我已经编写了附件查询。它在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]