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 2000 Forums
 SQL Server Development (2000)
 running sp from bcp

Author  Topic 

mikejohnson
Posting Yak Master

153 Posts

Posted - 2004-12-14 : 10:27:16
Posted - 12/14/2004 : 10:08:27
--------------------------------------------------------------------------------

when running the following code in my job, it seems it runs twice. but when calling the sp, everything works fine only once. what's the deal?

declare @filename varchar(200)
select @filename = 'D:\Inetpub\ACHFiles\avantis\ACH' + convert(varchar(10),getdate(),12) + '.txt'
declare @cmd varchar(2000)
select @cmd = 'bcp "exec interadworks..spGetAchFileContent" queryout "' + @filename + '" -c -S"server" -U"user" -P"pass"'
exec master..xp_cmdshell @cmd

thanks

mikejohnson
Posting Yak Master

153 Posts

Posted - 2004-12-14 : 10:59:48
fixed it.
Go to Top of Page

Hippi
Yak Posting Veteran

63 Posts

Posted - 2004-12-14 : 11:22:37
quote:
Originally posted by mikejohnson

fixed it.


so post it
Go to Top of Page

mikejohnson
Posting Yak Master

153 Posts

Posted - 2004-12-14 : 15:57:03
i setup my sp to actually make the bcp call instead of having my job have the bcp call to exec the sp
Go to Top of Page
   

- Advertisement -