Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQLServerCentral.com
»
Articles Requested
»
Export with Headers
15 posts, Page 1 of 2
1
2
»»
Export with Headers
Rate Topic
Display Mode
Topic Options
Author
Message
Steve Jones - SSC Editor
Steve Jones - SSC Editor
Posted Thursday, November 18, 2010 2:23 PM
SSC-Dedicated
Group: Administrators
Last Login: 2 days ago @ 1:47 PM
Points: 31,406,
Visits: 13,722
How can you export data from a query, using bcp, SQLCMD, etc. and include the column headers at the top? The export would be CSV or other delimited text file.
Follow me on Twitter:
@way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
Post #1023170
Jeff Moden
Jeff Moden
Posted Thursday, November 18, 2010 8:13 PM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 12:30 PM
Points: 32,893,
Visits: 26,770
Steve Jones - SSC Editor (11/18/2010)
How can you export data from a query, using bcp, SQLCMD, etc. and include the column headers at the top? The export would be CSV or other delimited text file.
Unless someone else has an absolute need to write this one, I'll be happy to take this one on. It won't include anything about SSIS, though. Might be better if that were a separate article, anyway.
Lemme know.
--Jeff Moden
"
RBAR
is pronounced "ree-bar" and is a "Modenism" for "
R
ow-
B
y-
A
gonizing-
R
ow".
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #1023265
Steve Jones - SSC Editor
Steve Jones - SSC Editor
Posted Friday, November 26, 2010 1:59 PM
SSC-Dedicated
Group: Administrators
Last Login: 2 days ago @ 1:47 PM
Points: 31,406,
Visits: 13,722
It would be good to have an SSIS and non/SSIS version
Follow me on Twitter:
@way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
Post #1026879
Jeff Moden
Jeff Moden
Posted Friday, November 26, 2010 4:08 PM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 12:30 PM
Points: 32,893,
Visits: 26,770
Since I don't actually know how to spell "SSIS", I'll take the non-SSIS version.
--Jeff Moden
"
RBAR
is pronounced "ree-bar" and is a "Modenism" for "
R
ow-
B
y-
A
gonizing-
R
ow".
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #1026903
gmby
gmby
Posted Wednesday, December 01, 2010 3:04 PM
Ten Centuries
Group: General Forum Members
Last Login: Thursday, May 16, 2013 8:26 AM
Points: 1,319,
Visits: 2,993
I doubt whether a complete article is needed for SSIS. The connection managers for Excel and flat files presents a check box to determine whether you want the first row to be column names.
jg
Post #1028972
Grant Fritchey
Grant Fritchey
Posted Thursday, December 02, 2010 6:27 AM
SSChampion
Group: General Forum Members
Last Login: Today @ 12:19 PM
Points: 13,371,
Visits: 25,144
For the non-SSIS version, what language are you using? Because if it's not PowerShell, I might want to do one using PowerShell.
----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of:
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans
Product Evangelist for
Red Gate Software
Post #1029200
Jeff Moden
Jeff Moden
Posted Thursday, December 02, 2010 10:16 PM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 12:30 PM
Points: 32,893,
Visits: 26,770
Grant Fritchey (12/2/2010)
For the non-SSIS version, what language are you using? Because if it's not PowerShell, I might want to do one using PowerShell.
Steve asked for "using bcp, SQLCMD", but I think one on PowerShell should come out first. And, since I don't actually know how to spell "PowerShell", I'd be tickled to see a "Grant Fritchey" article on such a thing. I can write on something else.
--Jeff Moden
"
RBAR
is pronounced "ree-bar" and is a "Modenism" for "
R
ow-
B
y-
A
gonizing-
R
ow".
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Post #1029639
WayneS
WayneS
Posted Thursday, December 02, 2010 10:36 PM
SSCertifiable
Group: General Forum Members
Last Login: Today @ 10:50 AM
Points: 6,367,
Visits: 8,227
Grant Fritchey (12/2/2010)
For the non-SSIS version, what language are you using? Because if it's not PowerShell, I might want to do one using PowerShell.
That would be quite cool!
Wayne
Microsoft Certified Master: SQL Server 2008
If you can't explain to another person how the code that you're copying from the internet works, then
DON'T USE IT
on a production system! After all,
you
will be the one supporting it!
Links:
For better assistance in answering your questions
,
How to ask a question
,
Performance Problems
,
Common date/time routines
,
CROSS-TABS and PIVOT tables Part 1
&
Part 2
,
Using APPLY Part 1
&
Part 2
,
Splitting Delimited Strings
Post #1029648
Grant Fritchey
Grant Fritchey
Posted Friday, December 03, 2010 5:43 AM
SSChampion
Group: General Forum Members
Last Login: Today @ 12:19 PM
Points: 13,371,
Visits: 25,144
Jeff Moden (12/2/2010)
Grant Fritchey (12/2/2010)
For the non-SSIS version, what language are you using? Because if it's not PowerShell, I might want to do one using PowerShell.
Steve asked for "using bcp, SQLCMD", but I think one on PowerShell should come out first. And, since I don't actually know how to spell "PowerShell", I'd be tickled to see a "Grant Fritchey" article on such a thing. I can write on something else.
Let's see what the boss says. I don't know why you couldn't do both.
----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of:
SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans
Product Evangelist for
Red Gate Software
Post #1029794
Gift Peddie
Gift Peddie
Posted Friday, December 03, 2010 6:35 AM
Hall of Fame
Group: General Forum Members
Last Login: Friday, March 29, 2013 11:17 AM
Points: 3,432,
Visits: 14,332
gmby (12/1/2010)
I doubt whether a complete article is needed for SSIS. The connection managers for Excel and flat files presents a check box to determine whether you want the first row to be column names.
jg
The above just means you don't know what you can do with SSIS; I have almost 1,000 lines of code using SSIS. You can turn header on and off, encapsulations on and off and delimiter agnostic using configurations.
Kind regards,
Gift Peddie
Post #1029823
« Prev Topic
|
Next Topic »
15 posts, Page 1 of 2
1
2
»»
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.