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
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 DTS to dump data to text file - update - BCP?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Maquis
Starting Member

25 Posts

Posted - 04/19/2004 :  10:56:32  Show Profile  Reply with Quote
Update - OK, I'm trying BCP instead...but I want the columns to be pipe-delimited and quoted...and I'm not a bcp guru. Right now I'm using the command:

set @cmd = 'bcp "SELECT * FROM test..activities" queryout \\server\testSQL\activities.txt -c -t"|" -Ssqlprod'
EXEC master..xp_cmdshell @cmd

...and that seems to work, except I can't get it double-quoted - help?

Original question:
I am trying to use a dts package to dump about 45 tables out to pipe-delimited text files...I can create the first one fine using the wizard, but I want all of them to be in one dts package. When I try to manually create the transformations, Ent Mgr barfs on me - says the memory could not be read - and exits. I can select the source, but the destination comes up empty - when I try to define the columns on the destination it gives me the memory error. After playing with this all morning, it appears to work ok on some tables - but not others! and I can't determine what the magic condition is (number/type of columns, etc.) Anybody have this happen to them? Any ideas?

Edited by - Maquis on 04/19/2004 11:30:19

X002548
Not Just a Number

15586 Posts

Posted - 04/19/2004 :  17:03:48  Show Profile  Reply with Quote
OK, stupid question time....(I'm very good at that)

Why do you want he quotes?

Did you try ""|""

???



Brett

8-)
Go to Top of Page

Maquis
Starting Member

25 Posts

Posted - 04/19/2004 :  17:07:17  Show Profile  Reply with Quote
The person that was going to use the output txt files wanted them quoted...but after I whined, he relented...so now I'm just using the pipe, and it seems to be working ok for him. Thanks!
Go to Top of Page

kohlang
Starting Member

1 Posts

Posted - 04/07/2009 :  20:45:11  Show Profile  Reply with Quote
How can I insert field labels to the output text file?
Go to Top of Page

markenloe
Starting Member

USA
1 Posts

Posted - 06/11/2009 :  15:10:10  Show Profile  Reply with Quote
just wanted to provide another example that works... thanks for all the posts.... (by the way, this reports on ssrs usage)

exec master..xp_cmdshell 'bcp "Select UserName, name as ReportName, timestart as ReportStart, timeend as ReportEnd, TimeRendering, TimeDataRetrieval, status as ReportStatus, c.[Name], Parameters From reportserver.dbo.ExecutionLog e inner join reportserver.dbo.Catalog c on e.reportid = c.ItemID where timestart > getdate()-30 order by timestart desc" queryout d:\perflogs\ssrsreport.txt -T -c -U sa -S server\instance'
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