June 27, 2006 at 1:39 pm
Hi Every body.
Suppose we have run the BCP command on a table and now we have a text file.
Is it possible to use this text file with a Query and Cursors to navigate throught it ? ( HOW ? )
Thanks alot for your help.
__..._-__
June 27, 2006 at 1:56 pm
The only way that I am aware of is if you would read that file back into a table and query that table, but that just puts you back at square one again doesn't it. Why can't you query the data in your table instead of the file?
June 27, 2006 at 2:36 pm
Thanks alot for your attention.
Beacuse I make the text file on clients and then it is uploaded to a SQL Server located on Internet. ( Sql Server Host).
That is why I need to Query that text file and use Cursors for it.
__..._-__
June 27, 2006 at 2:41 pm
I guess I'm still not quite clear on the need to query the text file (especially using cursors). So you generate a text file on client machines using BCP, then you send them to a central repository on your Internet facing SQL Server? Why not load the data into a table on your 'host' server and query it there?
June 28, 2006 at 8:06 am
Load your text file into Excel, or BCP in into an another table
Bye
Gabor
June 29, 2006 at 3:09 am
Thanks for your attention.
I am thinking of this way :
I make an XML file from my table ( Using BCP, QUERY & FOR XML option) then I can Upload it to my server. Afterwards I make an empty table with the same structure on the server and Import the XML file to it and then it is ok to use cursors on that table.
But I am NOT sure wether or not, I can Import an XML file into a Table .... Maybe I should use the OPENXML or other commands ...
I appreciate your opinions ...
Thanks.
__..._-__
June 29, 2006 at 5:41 am
You should not use XML for this.
A simple BCP out to a TAB (or what ever) delimited file, then BCP in is the best and most efficient way. Instead of BCP you can use DTS as well.
And instead of the BCP in you can use the TSQL bulk insert command
Bye
Gabor
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply