473,396 Members | 2,059 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

write text files in transac sql

Hi

I need create, write and read text files in a procedure transac sql
from sql server 2000
How i do this ??


Thanks,
Jul 20 '05 #1
3 10156

"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
Jul 20 '05 #2
raulgz (ra****@ozu.es) writes:
I need create, write and read text files in a procedure transac sql
from sql server 2000
How i do this ??


In additions to Simon's response, I like to add that you should think
twice before you do this. If you are importing and exporting data,
that's alright. Use BULK INSERT or call bcp from xp_cmdshell. But if
you are up to something else, you should probably consider to do it
client-side.

--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #3


Thank very much,

Really I need create txt files with dinamic
sql reading sql server catalog, the bettet solution
is create this files in client side.
Thanks again
RaulGZ.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: jajoo | last post by:
Hi everyone, I am trying to send files with multipart/form-date. Everything is ok with the send. But when I am receiving the files I should specify a directory where the files to be saved. The...
15
by: Viviana Vc | last post by:
How can I programatically do the equivalent of the following: cacls "C:\Program Files\test" /T /G Everyone:f ? Thanks, Viv
16
by: nephish | last post by:
Hey there, kinda newbie question here. i know how to read the lines of a txt file. i know how to write a txt file. but how do i overwrite a line value with another value ? i mean, how do go...
1
by: Magix | last post by:
Hi, I have these string data: str_data1, str_data2, str_data3, which capture some value after a routine process A. Then I would like to write (append) these 3 string values into a text file each...
1
by: Erich | last post by:
Hi, everybody! I would like my WebApp (ASP.NET) writes a text-file in my Web Host, so I could download it and import it to another application. Does anybody know how can I write a text file...
1
by: Gregory Gadow | last post by:
I have a folder on \\webserver\wwwroot, called staticContent. The folder has several message of the day text files, such as RepMotd.text. I have an admin page, AdminMotd.aspx, that allows a user to...
0
by: DC | last post by:
The problem I'm using the .NET GridView and FormView objects for the first time and im getting the error "An OleDbParameter with ParameterName '@ID' is not contained by this...
0
by: lion | last post by:
I have in my programm three files: SCANNER.CPP,tst_scanner.cpp and scaner.h i need read and write from text file which is glopal. how i can do it? the strange things if i put all programm in one...
2
kamill
by: kamill | last post by:
i need to write content of one text file into another text file. My code is working ,if i choose both files from same directory where my program reside..BUT,its not working if i select files from...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.