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.
Any insight will be greatly appreciated.
Capture.PNG
Capture2.PNG
SELECT * into WOYTRN01 FROM OPENQUERY(ATQAV, 'SELECT * FROM WOYTRN01 where 1=0')
INSERT INTO WOYTRN01
SELECT * FROM OPENQUERY(ATQAV, 'SELECT * FROM WOYTRN01')
ALTER TABLE [LOKAD].[dbo].[WOYTRN01] ALTER COLUMN [ITEM] varchar(35)
Any insight will be greatly appreciated.
Capture.PNG
Capture2.PNG
ASKER
Actually the correct statement is:
I use this statement to insert data from the linked Server to SQL Server and this works fine.
INSERT INTO WOYTRN01
SELECT * FROM OPENQUERY(ATQAV, 'SELECT * FROM WOYTRN01')
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
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
ASKER
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?
ASKER
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
ASKER
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.
ASKER
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Found the FTP was corrupt.
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)