Wednesday, March 7, 2012

OLE DB error 7314

Hi,

I have had a SQL Server 7 job running for 2 years. The job exports data from an ACT database and imports it into a SQL Server seven database. I have a link created through OLE DB provider for ODBC. The data is being exported out in a dbase 5.0 format and being imported into a SQL Server 7 format.
As I stated before everything has worked fine for 2 years and now I am getting the following error:

OLE DB provider 'MSDASQL' does not contain table '`F:\`\`FOLLETT2`'. [SQLSTATE 42000] (Error 7314). The step failed.

Has anyone seen this error before and if so, what was the cause and what did they do about it?

Any help would be greatly appreciated.

Thanks
PhilAre you using dts ?|||Originally posted by rnealejr
Are you using dts ?

No, we created a link to the server with the ACT database. We also have the server and directory mapped on the server where SQL Server is located. Then we have a stored procedure the imports the data from the FOLLETT2 database into the SQL Server database.

Thanks for your reply
Phil|||Try it with dts and see if you receive the same error. Other than importing - what additional coding are you doing in the stored procedure ? Post the statement that it is failing on within the stored procedure.|||Here is the code that is running:
------------------------
CREATE procedure procImportActStoreData as

DECLARE @.e INT
DECLARE @.emailRecipients varchar(2000)
DECLARE @.EmailMessage varchar(2000)

/*
SET @.EmailRecipients = 'szahn@.fheg.follett.com;abrow@.fheg.follett.com;' +
'stardecilla@.fheg.follett.com;jparins@.fheg.follett .com;' +
'sgallo@.fheg.follett.com;ddec@.fheg.follett.com'
*/

delete from ACTStore

insert into ACTStore(sys_typ_cd,
shp_to_acct_num,
store_med_size,
store_med_type,
store_num,
store_nam,
store_cty,
store_st,
store_zip,
store_cntry_cd,
idstatus,
store_med,
CMBBSystem)
select case user3
when 'Courseworks NT' then 'CWN'
when 'Courseworks SA' then 'CW'
when 'Buy Back Plus' then 'PC'
when 'PC Tom Tracks' then 'PC'
when 'EBB+' then 'PC'
when 'Tom Tracks 6000' then 'T6K'
when 'Tom/36' then 'S36'
when 'CW Buyback' then 'CWB'
else 'OTH' end,
usr1076,
usr1030,
usr1069,
usr1014,
company,
city,
state,
zip,
country,
idstatus,
case isnull(usr1069, '') + isnull(usr1030, '')
when '' then null
else isnull(usr1069, '') + isnull(usr1030, '') end,
user3
from ACT.[F:\]..FOLLETT2
where IDStatus IN ('Current Customer', 'Current Customer - FCSC')
--and usr1076 != '99999999999'

delete from ACTStore
where shp_to_acct_num = '99999999999'

SET @.e=@.@.ERROR

IF (@.e != 0)
BEGIN
/*
SET @.EmailMessage = 'ACT import failed on ' +
CONVERT(VARCHAR, GETDATE(), 100) +
' at stage 000. Error number = ' +
convert(varchar, @.e)

exec master..xp_sendmail @.recipients = @.EmailRecipients,
@.message = @.EmailMessage,
@.subject = 'TANDATA Import FAILURE'
*/
RAISERROR ('Error importing ACT (000)', 0, 1)
RETURN
END

update ACTStore
set RecStatus = 'N'
where not exists (select 1
from STORE s
where ACTStore.shp_to_acct_num = s.shp_to_acct_num)

SET @.e=@.@.ERROR

IF (@.e != 0)
BEGIN
/*
SET @.EmailMessage = 'ACT import failed on ' +
CONVERT(VARCHAR, GETDATE(), 100) +
' at stage 001. Error number = ' +
convert(varchar, @.e)

exec master..xp_sendmail @.recipients = @.EmailRecipients,
@.message = @.EmailMessage,
@.subject = 'TANDATA Import FAILURE'
*/
RAISERROR ('Error importing ACT (001)', 0, 1)
RETURN
END

update ACTStore
set old_sys_typ_cd = s.sys_typ_cd,
old_store_med = s.store_med
FROM STORE s
WHERE ACTStore.shp_to_acct_num = s.shp_to_acct_num

SET @.e=@.@.ERROR

IF (@.e != 0)
BEGIN
/*
SET @.EmailMessage = 'ACT import failed on ' +
CONVERT(VARCHAR, GETDATE(), 100) +
' at stage 002. Error number = ' +
convert(varchar, @.e)

exec master..xp_sendmail @.recipients = @.EmailRecipients,
@.message = @.EmailMessage,
@.subject = 'TANDATA Import FAILURE'
*/
RAISERROR ('Error importing ACT (002)', 0, 1)
RETURN
END

update ACTStore
set RecStatus = 'U'
where ((store_med is null and old_store_med is not null) OR
(store_med is not null and old_store_med is null) OR
(store_med != old_store_med) OR
(sys_typ_cd is null and old_sys_typ_cd is not null) OR
(sys_typ_cd is not null and old_sys_typ_cd is null) OR
(sys_typ_cd != old_sys_typ_cd))
and RecStatus is null

SET @.e=@.@.ERROR

IF (@.e != 0)
BEGIN
/*
SET @.EmailMessage = 'ACT import failed on ' +
CONVERT(VARCHAR, GETDATE(), 100) +
' at stage 003. Error number = ' +
convert(varchar, @.e)

exec master..xp_sendmail @.recipients = @.EmailRecipients,
@.message = @.EmailMessage,
@.subject = 'TANDATA Import FAILURE'
*/
RAISERROR ('Error importing ACT (003)', 0, 1)
RETURN
END

update store
set sys_typ_cd = a.sys_typ_cd,
store_med = a.store_med
from ACTStore a
where store.shp_to_acct_num = a.shp_to_acct_num

SET @.e=@.@.ERROR

IF (@.e != 0)
BEGIN
/*
SET @.EmailMessage = 'ACT import failed on ' +
CONVERT(VARCHAR, GETDATE(), 100) +
' at stage 004. Error number = ' +
convert(varchar, @.e)

exec master..xp_sendmail @.recipients = @.EmailRecipients,
@.message = @.EmailMessage,
@.subject = 'TANDATA Import FAILURE'
*/
RAISERROR ('Error importing ACT (004)', 0, 1)
RETURN
END
/* SET @.EmailMessage = 'ACT import succeeded on ' +
CONVERT(VARCHAR, GETDATE(), 100) +
'. Please remember to run your Exception and Updated Store reports.'

exec master..xp_sendmail @.recipients = @.EmailRecipients,
@.message = @.EmailMessage,
@.subject = 'ACT Store Data Import SUCCESS'

*/

And below is the section of code that is failing:

insert into ACTStore(sys_typ_cd,
shp_to_acct_num,
store_med_size,
store_med_type,
store_num,
store_nam,
store_cty,
store_st,
store_zip,
store_cntry_cd,
idstatus,
store_med,
CMBBSystem)
select case user3
when 'Courseworks NT' then 'CWN'
when 'Courseworks SA' then 'CW'
when 'Buy Back Plus' then 'PC'
when 'PC Tom Tracks' then 'PC'
when 'EBB+' then 'PC'
when 'Tom Tracks 6000' then 'T6K'
when 'Tom/36' then 'S36'
when 'CW Buyback' then 'CWB'
else 'OTH' end,
usr1076,
usr1030,
usr1069,
usr1014,
company,
city,
state,
zip,
country,
idstatus,
case isnull(usr1069, '') + isnull(usr1030, '')
when '' then null
else isnull(usr1069, '') + isnull(usr1030, '') end,
user3
from ACT.[F:\]..FOLLETT2
where IDStatus IN ('Current Customer', 'Current Customer - FCSC')
--and usr1076 != '99999999999'

And this is the error that I am getting:

Server: Msg 7314, Level 16, State 1, Line 15
OLE DB provider 'MSDASQL' does not contain table '`F:\`\`FOLLETT2`'.

It is very confusing to me that something that has worked for 2 years all of a sudden just stops working.

thanks
Phil

No comments:

Post a Comment