Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 1st, 2006, 01:55 AM
Registered User
 
Join Date: Feb 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Timcung
Default Linked server to text file problem

I need your HELP! I having problem with link to a text file and refer to the contents by using a dot '.' instead of '#' in the file name. Everthing work fine if I use the '#' for extension seperator. The problem is the existing stored procedures require the text file to contain a dot instead of a '#'.

We have 4 servers and 2 were working fine with the text files containing a dot '.', but the other two will always failed doesn't matter if I rebuild the whole server from scratch!

There must be some server setting that allow internal conversion of '#' to a dot '.' or similar. What is that setting?

Has anyone been through what I have prbolem with? Below are the actual codes that describe the prblem:


EXEC sp_droplinkedsrvlogin @rmtsrvname = 'TEST3', -- name of a linked server that the login mapping applies to
            @locallogin = NULL -- login on the local server
EXEC sp_DropServer @server = 'TEST3'


EXEC sp_addlinkedserver @server = 'TEST3', -- name of the linked server to create
                    @srvproduct = 'JET', -- product name of the OLE DB data source to add as a linked server
                    @provider = 'Microsoft.Jet.OLEDB.4.0', -- unique programmatic identifier (PROGID) of the OLE DB provider corresponding to this data source, ie 'Microsoft.Jet.OLEDB.4.0'
                        @datasrc = '\\Jekyll\CWPImport\PPDirect\AdelaideBank\TD', -- name of the data source as interpreted by the OLE DB provider, ie 'C:\Data'
-- @location = @location, -- location of the database as interpreted by the OLE DB provider
                    @provstr = 'Text' -- OLE DB provider-specific connection string that identifies a unique data source, ie 'Text'


/* create a mapping between logins on the local server running Microsoftc SQL Server and
remote logins on the linked server */
EXEC sp_addlinkedsrvlogin @rmtsrvname = 'TEST3', -- name of a linked server that the login mapping applies to
                @useself = FALSE, -- name of the login used to connect to the remote server
                @locallogin = NULL, -- login on the local server
                @rmtuser = NULL, -- username used to connect to rmtsrvname when useself is false
                @rmtpassword = NULL -- password associated with rmtuser

sp_helpserver 'TEST3'

------------------------------------------------------
SELECT * FROM [TEST3]...[Trans#csv]
It's return all rows fine.

-----------------------------------------------------
SELECT * FROM [TEST3]...[Trans.csv] (But this script work fine on the other server)

Server: Msg 7314, Level 16, State 1, Line 1
OLE DB provider 'TEST3' does not contain table 'Trans.csv'. The table either does not exist or the current user does not have permissions on that table.
OLE DB error trace [Non-interface error: OLE DB provider does not contain the table: ProviderName='TEST3', TableName='Trans.csv'].

Please Help.

Best Regards
Tim

 
Old September 26th, 2008, 05:00 PM
Registered User
 
Join Date: Sep 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi, I´m having the same problem. Did you solve it? can you tell me what to do. Thanks

Alberto
 
Old September 26th, 2008, 08:49 PM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 475
Thanks: 0
Thanked 9 Times in 9 Posts
Default

Ummm... the linked server requires # for the extension symbol and I'm pretty sure you cannot change that. If you have a list of file names with the dot symbol, just do a REPLACE before you use it with the linked server. This will probably require a bit of dynamic SQL because you can't use a variable in the FROM clause.

--Jeff Moden





Similar Threads
Thread Thread Starter Forum Replies Last Post
Uploading Text File to FTP server in vb.net KiruShan .NET Framework 2.0 4 July 29th, 2014 02:02 AM
how to insert text file in sql server database sharvari_mothe Java Databases 3 June 5th, 2007 07:25 AM
Save a text file on SQL Server petercyriljones SQL Server DTS 2 January 3rd, 2007 07:35 AM
Upload a Text file from a Web Client to SQL Server petercyriljones Classic ASP Professional 0 May 20th, 2005 10:26 AM
import text file to SQL Server DB via DTS pabloron SQL Server 2000 0 July 31st, 2003 06:41 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.