HELP HELP HELP!!!!

HELP HELP HELP!!!!

Post by td » Sat, 24 May 2003 00:32:30



Hi all,
Is there a way to export a sql table into a .csv file
format within a stored procedure?

Thanks,
td

 
 
 

HELP HELP HELP!!!!

Post by Omri Baha » Sat, 24 May 2003 01:29:48


This is a fairly trivial answer that I don't know whether you have
considered before but here goes:

Use the xp_cmdshell to run a shell command.
Let the shell command be a select command using bcp.

For example:

exec master..xp_cmdshell 'bcp "SELECT * FROM MyDatabase.dbo.MyTable
ORDER BY MyRow ASC" queryout c:\MyOutputFile.csv -c -T -S', no_output

Note that the format of the output file can be determined by you in the
query, by writing the SELECT command used in the bcp appropriately.

Hope this helps,

Omri.

---------------------------------------
Omri Bahat
DB Project Manager at Riptech
2800 Eisenhower Ave, 2nd floor
Alexandria, VA 22314
---------------------------------------

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

 
 
 

1. help,help,help,help,help,help,help,help,help,help,help,help,help,

Hi,
I have a small problem, and if you know the answer I would really be
thankful for your help.
I have an access database which is called "Client.mdb"
on a form, I displayed a dbcombox for the costumer's name
a textbox for the address
a textbox for the city
a textbox for the state
and a textbox for the zipcode

on all my textboxes and the dbcombobox I have set their Datasource and
Datafield properties to Data1,
when I run the program the information on the first record of the data shows
on the form,

but what I need to do is, when I change the costumer's name on the
dbcombobox (which displays all of the costumer's names on it) I want the
textboxes to show the address, city, state, and zipcode of the costumer I
have choosen,

Thank you in advance,
Enrique G Lugo

2. Performance Issue

3. help help help help help help help help help

4. Where does DTS pakcage save in MSSQL 7?

5. Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,

6. Has any body Fought the Licensing Battle with MS SQL 7 and then "RunTime" Files?

7. SQL To ORACLE Help Help Help Help Help

8. Problems with named pipe with UniData

9. query:HELP! HELP HELP HELP HELP

10. Help help help help

11. HELP HELP HELP HELP!

12. HELP HELP HELP HELP

13. HELP HELP HELP