>>>I'm using this line to run an EXE. Sometimes the EXE is successful, and sometimes it's not. Is there a way to get whatever was displayed in the command window after it runs? I need to take a different action afterward depending on whether it was successful or not.
>>>
>>>
>>>EXEC MASTER.dbo.xp_cmdshell @Merge_Script, no_output
>>>
>>
>>EXEC @result = xp_cmdshell @Merge_Script, no_output
>>
>>
http://msdn.microsoft.com/en-us/library/ms175046.aspx>
>What would I use to search through @result for a specific string?
Result is either 1 or 0. It doesn't give you specific info about the failure.
But in general there are CHARINDEX and other functions to search in the string. Please check
http://fox.wikis.com/wc.dll?Wiki~VFPSQL-TSQL-Mapping
If it's not broken, fix it until it is.
My Blog