"raulgz" <ra****@ozu.es> wrote in message
news:9b**************************@posting.google.c om...
Hi
I need create, write and read text files in a procedure transac sql
from sql server 2000
How i do this ??
Thanks,
To read in a file of data to a table, you can use BULK INSERT, but
unfortunately there is no equivalent for writing out to a file. A common
solution is to use xp_cmdshell to call bcp.exe or osql.exe.
An alternative, if you have the appropriate permissions, is to use the
sp_OA% procedures to instantiate the FileSystemObject and read/write that
way. Or perhaps write an external script, then execute it using xp_cmdshell.
Simon