Re: "Linked Table" from a .txt file in SQL Server?



Something similar would be to create a linked server to
access the text file. You use the Jet provider and set the
data source to the directory which has the text files you
want to access.
EXEC sp_addlinkedserver @server ='TextLinkServer',
@srvproduct='',
@provider ='Microsoft.Jet.OLEDB.4.0',
@datasrc='D:\',
@provstr='Text'

You could then get a list of all text files in the directory
if you execute:
EXEC sp_tables_ex 'TextLinkServer'

You can access the files as listed in the directory. Use the
table_name listed when you execute sp_tables_ex which is the
text file name.
select *
from TextLinkServer...[YourFile#txt]
to access D:\YourFile.txt

-Sue

On Wed, 6 Apr 2005 16:05:04 -0700, "Joel"
<Joel@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

>OKay, I'm really, really good with MS Access, but am just getting up to speed
>on SQL Server. Is there a SQL Server equivalent of linking (not importing) a
>table from a .txt file?
>
>Thanks!

.



Relevant Pages

  • Re: Dynamic SQL generation is not supported against a SelectCommand that does not return any base ta
    ... When you execute Update (for the first ... UpdateCommand etc. See my article on the CommandBuilder and why it should be ... SQL Server or MS Access. ... Code works fine with MS SQL Server. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: E-Mail Nachricht an Operator
    ... Man kann ja mit dem SQL Server ... SQL Server-Agent / Operatoren ... EXECUTE msdb.dbo.sysmail_add_account_sp ...
    (microsoft.public.de.sqlserver)
  • Re: exec() gives output??
    ... > I'd like to execute a command on the server ... > particular command takes a long time to execute, ... A successful call to exec() replaces the Perl script with whatever execis ...
    (comp.lang.perl.misc)
  • Re: Error running sql command
    ... If the commands are in a table on the server, I would create strings on the server and use SQL EXECUTE to execute them... ... I fetch a command from a table, process it and if command executes successfully I delete it form the queue. ... The basic problem with your code is that you are not using SQL Server as it should be used. ...
    (microsoft.public.dotnet.framework.adonet)
  • it all started on 5/27....
    ... individual DTS packages on SQL Server 2000 SP 4 that import and convert ... The SQL lives on a separate server than Pervasive. ... the same machine as SQL Server 2K SP 4. ... Now, if I execute the DTS packages individually on the server, all ...
    (microsoft.public.sqlserver.dts)