Link to home
Start Free TrialLog in
Avatar of maximus1974
maximus1974

asked on

SQL Server 208R2 not recognizing DBF file in linked Server

I am having an issue where SQL Server does not see a Foxpro DBF file when I attempt to import using SSIS. I see all other files except WOYTRN01.dbf. I am able to update with the following statements below which means SQL sees it via the linked Server and I have proper permissions. I am attempting to import a handful of DBF files from an old system to automate reporting.

SELECT * into WOYTRN01 FROM OPENQUERY(ATQAV, 'SELECT * FROM WOYTRN01 where 1=0')

Open in new window


INSERT INTO WOYTRN01
SELECT * FROM OPENQUERY(ATQAV, 'SELECT * FROM WOYTRN01')

Open in new window


ALTER TABLE [LOKAD].[dbo].[WOYTRN01] ALTER COLUMN [ITEM] varchar(35)

Open in new window


Any insight will be greatly appreciated.
Capture.PNG
Capture2.PNG
Avatar of lcohan
lcohan
Flag of Canada image

"I am able to update with the following statements below which means SQL sees it via the linked Server and I have proper permissions. "
I think you're actually changing a SQL table not the DBF file...what is this statement returning assuming ATQAV is your linked server name to the DBF file?

SELECT * FROM OPENQUERY(ATQAV, 'SELECT * FROM WOYTRN01)
Avatar of maximus1974
maximus1974

ASKER

Actually the correct statement is:
INSERT INTO WOYTRN01
SELECT * FROM OPENQUERY(ATQAV, 'SELECT * FROM WOYTRN01')

Open in new window


I use this statement to insert data from the linked Server to SQL Server and this works fine.
You can also use SQL SSMS and navigate to that Linked server then drill down until you see the tables and assuming WOYTRN01 is there Right click it to try a SELECT top something or just run in SQL query

SELECT * FROM [ATQAV]...[WOYTRN01];

see if it works.
You can also check that file properties at windows lever maybe is "Write-only" or hidden even though it doesn't look like from screen shots you posted as Attribute seems to be onle "A" - archived
Sorry, I understand what you are saying now. I am running the statement now and it takes usually 43 minutes to return results but it works with no errors. This tells me SQL is able to see the dbf through the linked Server.
OK so is just SSIS that is not "seining" that table and other than name due to some weird chars hidden in it or leading/trailing invisible space I can't really see a reason why is not visible in SSIS...if that is the only one table you have troble with - can you create a copy then rename that copy and see if that works?
I did copy the file's CDX and FPT to a directory on the SQL server and renamed it, same results.
what about the dbf itself? did you copied/renamed that one as well? cdx are compound indexes and fpt contains the data from Memo type fields. That would be insane if you copy/rename and still can't see that file/table alone. Maybe just put them back after rename as the linked server points to the folder where all the rest of them are not to any new folder unless you created a new linked folder
I created a foler on a separate folder and copied the three files and renamed all three TEST, DBF, TEST.CDX, and TEST.FPT. Pointed SSIS to the folder and nothing. If bring in another DBF that I am seeing into that folder, I see the new DBF. I am corruption. I have also made sure I have full permissions to the file.
new screenshots added of the process and message.
Capture.PNG
Capture2.PNG
ASKER CERTIFIED SOLUTION
Avatar of lcohan
lcohan
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Found the FTP was corrupt.