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
 Generating filename using parameters

Author  Topic 

wardsan
Starting Member

48 Posts

Posted - 2013-05-14 : 07:13:16
Folks,
I want to take in two parameters - week no. and year.
Then I need to generate a file called xxxxxx_<week no><year>
and then write the output from a query to the file retaining the column headers at the top of the file.
Does anyone have any idea of the best way to do this?
TIA
Sandra

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-05-14 : 07:16:58
yep use bcp

see

http://sqlblog.jfperry.com/jpsql/post/2008/10/22/BCP-out-table-data-with-Column-Names.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -