Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 .csv from SQL 2000
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

1 Posts

Posted - 10/09/2014 :  13:07:39  Show Profile  Reply with Quote

I need to have an automated extract from a sql 2000 who creates me .csv file
every end of the month.

Unfortunately the DB is an SQl 2000 .
so im not the Power Admin of SQL 2000.

Any one a ideas how it can create this extract job on a SQL DB?

Following Query will be used:

select PH.storeId,
RIGHT(PLC.CardNo,13) CardNo
from PosHeader PH
JOIN PosTransactions PT
ON PH.HeaderID = PT.HeaderID
JOIN PosLoyaltyCusts PLC
ON PT.GlobalTxnID = PLC.GlobaltxnID
WHERE PT.IsVoided = 0
AND PT.IsTranining = 0 and Ph.WorkDate between '2014-06-30 00:00:00' and '2014-09-28 00:00:00'

Hope some one have any idications how i can relase this on the SQL 2000.

Almighty SQL Goddess

38200 Posts

Posted - 10/09/2014 :  14:00:12  Show Profile  Visit tkizer's Homepage  Reply with Quote
Put the query into a view. Then run this command in a cmd window, modifying the parameters:

bcp "select * from XXXX.dbo.viewname" queryout c:\temp\somefile.csv -T -Sserver1\instance1 -c -t, -r\r\n

Tara Kizer
SQL Server MVP since 2007
Go to Top of Page
  Previous Topic Topic Next 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.02 seconds. Powered By: Snitz Forums 2000