I have a stored procedure that runs the following code but it gives me an error stating it can't find the stored procedure and displays the select statement with the correct variables. If I run the select in a query window hard coding the variables it works fine. Is this a permissions thing with the "exec" command?
set @select = 'select * into '+'test'+' from openrowset('+ ''''+'VFPOLEDB'+''''+','+''''+@path+''''+'; '+''' '''+'; '+''' '''+','+''''+'select * from '+@filename+''''+@paren
exec @select
set @select = 'select * into '+'test'+' from openrowset('+ ''''+'VFPOLEDB'+''''+','+''''+@path+''''+'; '+''' '''+'; '+''' '''+','+''''+'select * from '+@filename+''''+@paren
exec @select