I have a legacy Visual FoxPro application with flat tables that I needed to access the tables from SQL.
I create a Linked server on SQL Server Management studio.
The created a Database.
Create a stored procedure that copies certain tables to the database using openquery.
I scheduled a job to run the stored procedure at 6 minute intervals.
All works fine, except at the source location of the flat tables on FoxPro share, there are temp files being created. one file for each table in the stored procedure being written out at the 6 minute intervals.
What would cause these temp files form being written out?
Is there a configuration on the job or a command on the stored procedure that would prevent these files from being created?
I attached a screen pint of the temp files that are being written.
Here is the stored procedure.
**************
USE [DatabaseName]
GO
/****** Object: StoredProcedure [dbo].[CopyTables] Script Date: 2/19/2021 9:43:41 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[CopyTables]
-- Add the parameters for the stored procedure here
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
--1. Pull 5 tables from EPRMS to get live tool states
Drop Table TableName
SELECT *
INTO TableName
FROM OPENQUERY(LinkServerName,'select * from TableName
')
I create a Linked server on SQL Server Management studio.
The created a Database.
Create a stored procedure that copies certain tables to the database using openquery.
I scheduled a job to run the stored procedure at 6 minute intervals.
All works fine, except at the source location of the flat tables on FoxPro share, there are temp files being created. one file for each table in the stored procedure being written out at the 6 minute intervals.
What would cause these temp files form being written out?
Is there a configuration on the job or a command on the stored procedure that would prevent these files from being created?
I attached a screen pint of the temp files that are being written.
Here is the stored procedure.
**************
USE [DatabaseName]
GO
/****** Object: StoredProcedure [dbo].[CopyTables] Script Date: 2/19/2021 9:43:41 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[CopyTables]
-- Add the parameters for the stored procedure here
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
--1. Pull 5 tables from EPRMS to get live tool states
Drop Table TableName
SELECT *
INTO TableName
FROM OPENQUERY(LinkServerName,'select * from TableName
')