If you can schedule a DTS using Enterprise Manager, you can put a 'run
process' task in that.
Set it up and make sure it works independently of the rest of the DTS before
deploying it.
You can have quite complex logic in DTSes, namely go down one if success,
another if fail. Check out the 'Workflow' submenu when right-clicking when
two tasks are selected. You can use an ActiveX script task to
programatically set the success or fail status I think. You can also use
global variables.
[quoted text, click to view] "Justin Drennan" <justin@nospam.com> wrote in message
news:U4-dnf7cNc959fLcRVn-pg@is.co.za...
> Hi Bonj,
>
> I dont have the luxary of a client side application. Everything needs to
> be
> scheduled, and the output needs to be unique.
>
> I still have no idea how I am going to do this, if I dont use BCP!
>
>
> "Bonj" <benjtaylor at hotpop d0t com> wrote in message
> news:u7sJPpjsEHA.2556@tk2msftngp13.phx.gbl...
>> You sould execute BCP from a client, not from within a stored procedure.
>> You show assigning the command line to a string, but presumably you are
>> executing it using xp_cmdshell in code you haven't listed?
>> In this case, it could fail due to a number of reasons, such as the file
>> existing and being open, the table not existing, the server not having
>> 'Server' as a linked server, etc. etc.
>> Create a client program that controls the parameters for BCP and checks
>> these things.
>>
>>
>> "Justin Drennan" <justin@nospam.com> wrote in message
>> news:NdWdnV4iwai5UfPcRVn-vQ@is.co.za...
>> >I have a stored proc which executes a BCP. The problem is that the BCP
>> >is
>> > some what erratic! Sometimes it hangs, sometimes it creates the .csv
> file.
>> > Is there an alternative to getting some table outputted to a .csv file?
>> >
>> >
>> >
>> > The problem I have with the CSV is that the CSV file name needs to be
>> > created dynamically per day!
>> >
>> >
>> > Any recommendations?
>> >
>> >
>> >
>> > Here is the SP:
>> >
>> >
>> >
>> > set @string1 = 'bcp "select XYZ from Server.marketing.dbo.Table1"
>> > queryout
>> > \\fileserv\SQL\AutoMailer\G2R' + @filename + ' -T -S Server -c -t,'
>> >
>> >
>> >
>> > Any ideas?
>> >
>> >
>> >
>> >
>> >
>> >
>>
>>
>
>