Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BCP - with delimiters

Status
Not open for further replies.

kizziebutler

Programmer
Apr 28, 2005
81
GB
I would like to use bcp to export data from sql2000, but the queries are quite lengthy and I would like to include delimiters. I want to set up a rule of for example the date field contains a null value then replace this will sysdate followed by a delimiter. An example of this goes like this:

bcp "select '**rs**'+field1+'|'+convert(varchar(20), dtsstamp, 120)+' (I would like to put this out to a sysdate if the value is null in the column. Also if a field is numeric and contains a null value then replace this will a default value. Any ideas?
 
Your best and easiest bet would be to create a view that serves the data in manner desired and then BCP the data out from the view.

Shoot Me! Shoot Me NOW!!!
- Daffy Duck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top