Solved

SQL Server 208R2 not recognizing DBF file in linked Server

Posted on 2016-09-15
11
72 Views
Last Modified: 2016-09-20
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
0
Comment
Question by:maximus1974
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
11 Comments
 
LVL 40

Expert Comment

by:lcohan
ID: 41800464
"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)
0
 

Author Comment

by:maximus1974
ID: 41800472
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.
0
 
LVL 40

Expert Comment

by:lcohan
ID: 41800476
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
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

Author Comment

by:maximus1974
ID: 41800482
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.
0
 
LVL 40

Expert Comment

by:lcohan
ID: 41800491
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?
0
 

Author Comment

by:maximus1974
ID: 41800523
I did copy the file's CDX and FPT to a directory on the SQL server and renamed it, same results.
0
 
LVL 40

Expert Comment

by:lcohan
ID: 41800539
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
0
 

Author Comment

by:maximus1974
ID: 41800571
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.
0
 

Author Comment

by:maximus1974
ID: 41800583
new screenshots added of the process and message.
Capture.PNG
Capture2.PNG
0
 
LVL 40

Accepted Solution

by:
lcohan earned 500 total points
ID: 41801737
If that is the only file that gives you trouble and this is one-time task why you can't import this file only via the T-SQL that works and everything else via SSIS?
0
 

Author Closing Comment

by:maximus1974
ID: 41807449
Found the FTP was corrupt.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question