Using xp_scan_xbase

The XP.DLL extended stored procedure xp_scan_xbase accesses a dBASE III® - or dBASE IV® - based file and returns the contents as a relational results set. This procedure is an example of how to access data that is not held in a relational database and how to return results in a form that can be used by a SQL Server client. The xp_scan_xbase extended stored procedure takes as an argument the full pathname of the database file, enclosed in quotation marks. For example:

declare @retstatus int
@retstatus=execute xp_scan_xbase
    "c:\sql\opends\samples\procsrv\build\sales.dbf"
select @retstatus

This example accesses the specified file and returns its contents as a relational results set. By declaring and using a return status variable, this example also shows how to access the return values from extended stored procedures.

The xp_scan_xbase sample code demonstrates the use of a default parameter in an extended stored procedure. If the caller does not specify a parameter, this procedure accesses a sample dBASE-formatted file that is included with the sample for the purposes of demonstration.