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
 General SQL Server Forums
 New to SQL Server Programming
 SQL PROCEDURE

Author  Topic 

Smita86
Starting Member

5 Posts

Posted - 2009-05-16 : 12:31:11
I want to make a procedure in which data from one table can be automatically stored in a text file at a specific time.Plz help.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-05-16 : 12:39:43
You will have to write a JOB for this.
Use BCP to fetch data from table and write into a file.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

Smita86
Starting Member

5 Posts

Posted - 2009-05-16 : 12:43:42
can u provide me that code?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-05-16 : 14:39:02
http://sqlblogcasts.com/blogs/madhivanan/archive/2007/08/27/bcp-export-data-to-text-file.aspx
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-05-16 : 14:39:28
Other than present in Books Online, you mean?



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

Smita86
Starting Member

5 Posts

Posted - 2009-05-17 : 05:55:59
thanks and wat if i need it to be executed at 12:00 am in midnight daily
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-05-17 : 06:57:33
Set a schedule for the job.


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

Smita86
Starting Member

5 Posts

Posted - 2009-05-17 : 07:47:37
can u plz explain how to do this???
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-05-17 : 09:12:19
see this. remember to give bcp command as command for job

http://www.quackit.com/sql_server/tutorial/sql_server_agent_jobs.cfm
Go to Top of Page
   

- Advertisement -