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

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Does BCP works with store procedure?

Author  Topic 

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2009-11-10 : 14:13:29
I created a store procedure(e.g sGetData) to process data.
I have to use command line using BCP to export the result of store procedure to a XML file to another file server. (e.g. \\order\order.xml)
Is it possible? How to code it?

X002548
Not Just a Number

15586 Posts

Posted - 2009-11-10 : 15:23:10
DECLARE @cmd varchar(8000)
SET @cmd = 'bcp out db.dbo.table \\order\order.xml -T -c'
EXEC master..xp_cmdshell @cmd



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2009-11-10 : 15:28:40
did u read the reply to your previous post?

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=135620

<><><><><><><><><><><><><><><><><><><><><><><><><>
If you don't have the passion to help people, you have no passion
Go to Top of Page
   

- Advertisement -