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 output to flat file and scheduling the query

Author  Topic 

makraja
Starting Member

1 Post

Posted - 2010-08-17 : 03:41:39
Hi,
I am using sql server 2005.

1) I want to send my output to flat file prefarably csv format file with "|" as delimiter between each coloumn.

2) How can I schedule the sql query on particular time in a day.

Thanks in advance.

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2010-08-17 : 08:26:15
check BCP in books online and create a job to schedule it

--------------------
keeping it simple...
Go to Top of Page

slimt_slimt
Aged Yak Warrior

746 Posts

Posted - 2010-08-17 : 12:37:37
or you can create SSIS package with including mail sending and job for scheduling.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2010-08-17 : 13:15:10
quote:
Originally posted by makraja

Hi,
I am using sql server 2005.

1) I want to send my output to flat file prefarably csv format file with "|" as delimiter between each coloumn.



output of what? SQL, sproc, udf???

bcp dbname.dbo.table out d:\test.dat -T -Sservername -t"|" - c

quote:

2) How can I schedule the sql query on particular time in a day.

Thanks in advance.



By using a scheduled job using sql server agent..look in mangement studio (SSMS)



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page
   

- Advertisement -