I do something like....Select @Log_Id = IsNull(Max(IsNull(Log_Id,0)),0) + 1 From Tax_Load_LogSET @var = RTrim(Convert(Char(20),@Log_Id)) + '|U|'+RTrim(Convert(char(50),GetDate(),109))+'|Starting Quarterly Load Process'SET @cmd = 'echo ' + '"|' + @var + '|"' + ' > d:\Data\Tax\log_out.txt'SET @Command_string = 'EXEC master..xp_cmdshell ''' + @cmd + ''', NO_OUTPUT'Exec(@Command_String)
Make sure to use >> to append lines to the fileI then load this pipe delimeted file to the log table on the way out of the sprocs....Brett8-)