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 |
|
mapidea
Posting Yak Master
124 Posts |
Posted - 2010-02-23 : 14:15:19
|
| I get the error when I pass orders_ids separated by commas ...... too many argument specified.dvx_5_Export_ExportedData is a stored proc.How can I bcp a stored proc with parameters.ALTER PROCEDURE [dbo].[dvx_5_Export_GetTheExportData] @order_ids VARCHAR(3000)ASBEGIN declare @sql varchar(8000)select @sql = 'bcp "EXEC CTA_Web7..[dvx_5_Export_ExportedData]' + @order_ids + '" queryout E:\Sai\sysobjects.txt -c -t, -T -S' + @@servernameexec master..xp_cmdshell @sqlEND |
|
|
mapidea
Posting Yak Master
124 Posts |
Posted - 2010-02-23 : 14:40:41
|
| It was select @sql = 'bcp "EXEC CTA_Web7..[dvx_5_Export_ExportedData] ''' + @order_ids + '''" queryout E:\Sai\sysobjects.txt -c -t, -T -S' + @@servernameThanks. |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2010-02-23 : 14:55:23
|
| Change the exec master..xp_cmdshell @sqltoPRINT @sqluntil you have the syntax "nailed" |
 |
|
|
|
|
|