Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

How to spool the result of an query into a file in sql 2000

$
0
0

Hi All,

I have an SQL query which iterates through number of times for checking on some conditions and will return results each time. I wants to save the results into an different xml file each time. I tried using below query:

exec xp_cmdshell 'bcp "use Mimsadaptorlogs; select top 10 * from log order by logdate" queryout "D:\cdr_cg.xml" -T -c -t,'  ---> Its not working as expected.

I got the Below output:

-------------------------

NULL
Starting copy...
SQLState = 01000, NativeError = 5701
Warning = [Microsoft][ODBC SQL Server Driver][SQL Server]Changed database context to 'MIMSAdaptorlogs'.
NULL
10 rows copied.
Network packet size (bytes): 4096
Clock Time (ms.): total       62
NULL

-------------------------

Could you anuone please suggest me on this.......


Thanks and Regards, Bala


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>