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.
Author |
Topic |
morphviper
Yak Posting Veteran
60 Posts |
Posted - 2007-04-13 : 15:21:53
|
I have a stored procedure that is rather large and creates nicely formatted XML in a cell.Now what I want to do is get that cell into an xml file. I have found tons of articles, but none seem to fit my needs.I figured I would use BCP, but I cant seem to get it to work calling a stored procedure where I need to pass one parameter into the stored procedure.so I am really confused. Any help or pointing me to some articles that use BCP and stored procedures where they need to be passed a parameterThank you for any assistance! |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-04-13 : 16:14:23
|
Please show us an example.Tara Kizerhttp://weblogs.sqlteam.com/tarad/ |
 |
|
morphviper
Yak Posting Veteran
60 Posts |
Posted - 2007-04-13 : 16:48:33
|
bcp "EXEC RDC..CreateXML" queryout c:\Testingxml.xml -c -Uuser -PpassI am having trouble even getting this to work, but I need something like this but In need to send a parameter.what I send in query analyser is:exec createxml 1I was also looking at xp_cmdshell? |
 |
|
jezemine
Master Smack Fu Yak Hacker
2886 Posts |
|
dinakar
Master Smack Fu Yak Hacker
2507 Posts |
Posted - 2007-04-13 : 17:01:42
|
I havent used BCP + stored proc..but just a thought...You can create a temp table and use INSERT INTO EXEC to get the results into the temp table. Then you can use BCP to just create a file and do SELECT * FROM #tmp..CREATE TABLE #tmp...INSERT INTO #tmp EXEC <stored proc> <params>xp_cmdshell 'bcp queryout "SELECT * FROM #tmp" ....'************************Life is short. Enjoy it.************************http://weblogs.sqlteam.com/dinakar/ |
 |
|
|
|
|