January 11, 2007 at 8:34 pm
Hi..I am trying to read text file using OpenRowSet function for this my DBA was created linked Server with Name "DBLServerText", my text file path c:/txtcount.txt.
Please guide me syntax any one have idea.
Thanks in Advance..
Mure
January 11, 2007 at 10:33 pm
OpenRowSource and OpenRowSet in SQL Server 2000
http://www.databasejournal.com/features/mssql/article.php/10894_3331881_3
http://msdn2.microsoft.com/en-us/library/ms190312.aspx
MohammedU
Microsoft SQL Server MVP
January 12, 2007 at 10:50 am
Hi Sir,
As per your mail I used the following Syntax my text file Name : "txtrecon.txt" and the file is in "C:\External", But it is showing the Error.
select * from OpenRowset('MSDASQL', 'Driver={Microsoft Text Driver (*.txt)};
DefaultDir=C:\External;','select * from txtrecon.txt')
Server: Msg 7415, Level 16, State 1, Line 1
Ad hoc access to OLE DB provider 'MSDASQL' has been denied. You must access this provider through a linked server.
--
I Created Linked Server Name "txtsrv"
'Microsoft.Jet.OLEDB.4.0',
'c:\data\distqry',
NULL,
'Text'
GO
Please guide me how to read the text file
Thanks for your kind help
Mure
January 12, 2007 at 5:57 pm
Enable "Enable OPENROWSET and OPENDATASOURCE support" option in Surface Area Configuration Manager and try again.., I believe it is disabled by default.
MohammedU
Microsoft SQL Server MVP
January 18, 2007 at 8:09 am
Sir,
I didn't find out the option. Please guide me how to do this.
Thanks
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply