Accessing DBF from SQL Server 7.0 Using OpenQuery

Accessing DBF from SQL Server 7.0 Using OpenQuery

I read a SQL tip titled “Using Distributed Queries on SQL Server 7.0.” I think this is a great follow up to that tip. This is especially useful for those who want to migrate a selected DBF structure to SQL Server or to query DBF using the query analyzer.

SQL Server 7.0 provides two stored procedures (OpenQuery and OpenRowSet) for accessing different database formats, be it a DBF, MDB, or any other OLE DB- or ODBC-compliant database. The following example illustrates how OpenQuery is used.

 USE Master  -- sp_addlinkedserver can be executed 
only using the master databaseDECLARE @cConnStr VARCHAR(256) SET @cConnStr = 'DSN=GLDBF;DefaultDir=c:data;
DriverId=277;FIL=dBase IV' /* GLDBF is a datasource configured in your physical
server where the data is located. It is configured using the ODBC Data Source Administrator. DefaultDir
contains your DBF files. */EXECUTE sp_addlinkedserver @server=MyServer,
@srvproduct='dBase IV',@provider='MSDASQL', @provstr= @cConnStr /* use sp_addlinkedserver to add a virtual server
for your data source. */ select * from openquery(MyServer,'select * from
customer') /* you can now use openquery to access DBF files. */
Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of

kubernetes logging

Kubernetes Logging: What You Need to Know

Kubernetes from Google is one of the most popular open-source and free container management solutions made to make managing and deploying applications easier. It has a solid architecture that makes