microsoft newsgroup web access
     dot net    |    ms sql    |    ms access    |    office    |    windows    |   
Microsoft ms sql group
sqlserver.ce
sqlserver.clients
sqlserver.clustering
sqlserver.connect
sqlserver.datawarehouse
sqlserver.dts
sqlserver.fulltext
sqlserver.msde
sqlserver.mseq
sqlserver.notificationsvcs
sqlserver.odbc
sqlserver.olap
sqlserver.programming
sqlserver.replication
sqlserver.reportingsvcs
sqlserver.security
sqlserver.server
sqlserver.setup
sqlserver.tools
sqlserver.xml
  
    

Reading from file.



Is there any way through which we can read any file which exist in harddisk
like c:\File.txt, I want to read that file via Sql Server. Basically I want
to read xml file from the hard disk like c:\file1.xml.

I am making one project and the project instructions is to first generate
xml and save into harddisk and then read that xml from the harddisk and use
update query.

I would highly appreciate if any one help me regarding this.

Thanks
NOOR



Tue, 11 Jan 2005 13:16:03 -0500 "Noor"

RE: Reading from file.



Hi,
Noor You can read file from drive via following procedure :):)

EXEC sp_readerrorlog 1, 'e:\farhantest\Country.xml'

Best Regards,
Farhan Iqbal





"Noor" wrote:

> Is there any way through which we can read any file which exist in harddisk
> like c:\File.txt, I want to read that file via Sql Server. Basically I want
> to read xml file from the hard disk like c:\file1.xml.
>
> I am making one project and the project instructions is to first generate
> xml and save into harddisk and then read that xml from the harddisk and use
> update query.
>
> I would highly appreciate if any one help me regarding this.
>
> Thanks
> NOOR
>
>
>


Tue, 11 Jan 2005 20:45:03 -0800 =?Utf-8?B?RmFyaGFu?=

Re: Reading from file.



Farhan do u have any idea about this
Noor wrote:
> Thanks for your reply but can you tell me one thing. Basically I have
> received the output of the file like this
> _________________________________________________________________________________________________________
>
> Noorali
Ali

>
>
> 1 record affected
> _________________________________________________________________________________________________________
>
> now my question is that I want to remove the spaces as well as 1
> record affected like my out put should like this
> _________________________________________________________________________________________________________
>
> Noorali
Ali

> _________________________________________________________________________________________________________
>
> In the start I want to add xml tage as well as in the end tag so can
> you give me the exact query or can you plz amend this query
>





Wed, 12 Jan 2005 00:00:06 -0500 "Noor"

Re: Reading from file.



Step 1:

Exec master..xp_cmdshell
'OSQL -S"DATABASESERVER3" -d"SHOPPINGCART" -U"SA" -P"focus" -Q"set nocount
on select * From Country FOR XML AUTO, ELEMENTS"
-o"e:\farhantest\Country.xml" -h-1'


Step 2:

CREATE Procedure setXML (@Path varchar(200), @Db varchar(100)) as
Begin
Create Table #XML (xmlString varchar(8000), code bit)
drop table XMLTable
Create Table dbo.XMLTable (id int primary key,

Wed, 12 Jan 2005 04:59:06 -0800 =?Utf-8?B?RmFyaGFu?=

Re: Reading from file.



Thanks Farhan

"Farhan" wrote in message
news:F6E9F632-C218-4DA5-83AC-65A01C1CCF59@microsoft.com...
> Step 1:
>
> Exec master..xp_cmdshell
> 'OSQL -S"DATABASESERVER3" -d"SHOPPINGCART" -U"SA" -P"focus" -Q"set nocount
> on select * From Country FOR XML AUTO, ELEMENTS"
> -o"e:\farhantest\Country.xml" -h-1'
>
>
> Step 2:
>
> CREATE Procedure setXML (@Path varchar(200), @Db varchar(100)) as
> Begin
> Create Table #XML (xmlString varchar(8000), code bit)
> drop table XMLTable
> Create Table dbo.XMLTable (id int primary key, ReadXML


Thu, 13 Jan 2005 11:33:54 -0500 "Noor"


COPYRIGHT © 2004, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE
http://www.meetholland.com

advertisement:   complete list of microsoft newsgroup    |    uk based newsgroup    |