Solved

bcp - table to text file, how to capture field names

Posted on 2006-06-09
2
379 Views
Last Modified: 2008-02-26
How can I tell sql server to export field names of a table, along with it's data to a text file? I don't see a switch that does this?
0
Comment
Question by:Feyo
2 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 250 total points
ID: 16872642
In your Query put a select statement to select the filed names  followed by a UNION + the actual Query

Something like this

SELECT 'Address' UNION ALL SELECT Address FROM urTable
0
 
LVL 4

Author Comment

by:Feyo
ID: 16885127
Great. Thanks.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
top 100 or rank 100 teradata 4 38
MySQL 11 69
SQL Update Query 23 79
MSSQL Convert Char To Date 4 43
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now