Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Output to CSV file

Author  Topic 

nitin1353
Constraint Violating Yak Guru

381 Posts

Posted - 2009-07-30 : 01:19:29
Gurus,
I have a SP and now i want that output of that SP should be stored in CSV file.
Please Help
Regards
Nitin

rajdaksha
Aged Yak Warrior

595 Posts

Posted - 2009-07-30 : 01:24:05
Hi

you want this...refer
http://www.simple-talk.com/sql/database-administration/creating-csv-files-using-bcp-and-stored-procedures/


-------------------------
R..
Go to Top of Page

nitin1353
Constraint Violating Yak Guru

381 Posts

Posted - 2009-07-30 : 02:32:48
i want to schedule it thru bacth file also, i dont want to make a job(sql agent job)

How do i go about it
Regards
Go to Top of Page

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-07-30 : 02:37:19
quote:
Originally posted by nitin1353

i want to schedule it thru bacth file also, i dont want to make a job(sql agent job)

How do i go about it
Regards



BCP is a command line feature u can use in a batch file and schedule the batch file using Scheduled task in Control pannel

Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled

http://senthilnagore.blogspot.com/
Go to Top of Page

nitin1353
Constraint Violating Yak Guru

381 Posts

Posted - 2009-07-30 : 03:51:54
How do we exec a sp from bcp?
Regards
Go to Top of Page

asgast
Posting Yak Master

149 Posts

Posted - 2009-07-30 : 04:04:27
you don't exec a sp from bcp

create procedure that uses bcp to write into files
use sqlcmd to run sql scripts from a batch file
http://msdn.microsoft.com/en-us/library/ms162773.aspx
Go to Top of Page
   

- Advertisement -