SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Generating filename using parameters
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

wardsan
Starting Member

48 Posts

Posted - 05/14/2013 :  07:13:16  Show Profile  Reply with Quote
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

India
52309 Posts

Posted - 05/14/2013 :  07:16:58  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000