SQLState = S0002, NativeError = 208
Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Invalid object name 'SGMH_Reports.dbo.sp_RadLog'.
SQLState = 37000, NativeError = 8180
Error = [Microsoft][SQL Server Native Client 10.0][SQL Server]Statement(s) could not be prepared.
NULL
QUERY:
set @FileName =Convert(varchar(2),DatePart(MM,@EndDate))+'_'+
Convert(varchar(2),DatePart(DD,@EndDate))+'_'+
Convert(varchar(4),DatePart(YYYY,@EndDate))
Set @FileLoc = '\\sangorbandc02\data\FTPResend\RADADT\'
--Set @FileLoc = '\\it-dba\C$\TestFiles\'
Set @Command = 'bcp "Select * from SGMH_Reports.dbo.sp_RadLog" queryout "'+
RTrim(LTrim(@FileLoc))+'\ADT_'+@FileName+'.txt" -T -c -t^|'
print @Command
YFLORES