Results 1 to 3 of 3

Thread: xp_sendmail

  1. #1
    Join Date
    Aug 2002
    Location
    Charlotte NC
    Posts
    665

    Unanswered: xp_sendmail

    I have recently added columns to a table that is part of a xp_send mail script. meaning i run a query off of the table that had the columns added. I am now getting the error:
    failed with operating system error 32

    I have no idea what this means. This is a copy of the script.
    Code:
    exec xp_sendmail 'dionne, jim;eddens, david;Wiggs, Alexander;Miller, Debbie;conmdi', '(scrbbususcnc01) Failure 322 Load', @Attachments = '322Error.txt;\\scrbbususcnc01\archive\322msg\322MSG.txt;', @query = 'Use [maersk data warehouse] 
    create table #Duplicate_Records (Equipment_Number varchar(10)
    				,Activity_Date varchar(6)
    				,Activity_Time varchar(4)
    				,Sighting_Code varchar(2)
    				,CountOfEquipment_Number int)
    insert into #Duplicate_Records
    SELECT STG_INTERMODAL_322MSG_TBL.Equipment_Number, 
    STG_INTERMODAL_322MSG_TBL.Activity_Date, 
    STG_INTERMODAL_322MSG_TBL.Activity_Time, 
    STG_INTERMODAL_322MSG_TBL.Sighting_Code, 
    Count(STG_INTERMODAL_322MSG_TBL.Equipment_Number) AS CountOfEquipment_Number
    FROM STG_INTERMODAL_322MSG_TBL
    GROUP BY STG_INTERMODAL_322MSG_TBL.Equipment_Number, 
    STG_INTERMODAL_322MSG_TBL.Activity_Date, 
    STG_INTERMODAL_322MSG_TBL.Activity_Time, 
    STG_INTERMODAL_322MSG_TBL.Sighting_Code
    HAVING (((Count(STG_INTERMODAL_322MSG_TBL.Equipment_Number))>1))
    
    create table #None ([Equipment_Number] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    	[Equip_Nbr_11_Digit] [varchar] (11) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    	[Activity_Date] [varchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    	[Activity_Time] [varchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    	[Sighting_Code] [varchar] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    	[filler] [varchar] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    	[Location_City] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    	[Location_State] [varchar] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    	[Status] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    	[Train_Junction] [varchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    	[Send_Date] [varchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    	[Send_Time] [varchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    	[Road] [varchar] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    	[Destination_City] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    	[Destination_State] [varchar] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    	[Source] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    	[Flag] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    	[Flatcar_Number] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    	[Chassis_Number] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    	[Work_Order_Number] [varchar] (13) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    	[BKG_BL_Number] [varchar] (9) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    	[Train_ID] [varchar] (12) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    	[Last_Free_Date] [varchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    	[Process_Date] [datetime] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    	[splc_code] varchar(50) COLLATE SQL_Latin1_General_CP1_CI_AS null, 
    	[Origin_SPLC] [varchar] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    	[Operator] [varchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    	[Shpt_Type] [varchar] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
    	[Pickup_Number] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL )
    
    insert into #None
    SELECT DISTINCT STG_INTERMODAL_322MSG_TBL.*
    FROM [#Duplicate_Records] INNER JOIN STG_INTERMODAL_322MSG_TBL ON ([#Duplicate_Records].Sighting_Code = STG_INTERMODAL_322MSG_TBL.Sighting_Code) AND ([#Duplicate_Records].Activity_Time = STG_INTERMODAL_322MSG_TBL.Activity_Time) AND ([#Duplicate_Records].Activity_Date = STG_INTERMODAL_322MSG_TBL.Activity_Date) AND ([#Duplicate_Records].Equipment_Number = STG_INTERMODAL_322MSG_TBL.Equipment_Number)
    ORDER BY STG_INTERMODAL_322MSG_TBL.Equipment_Number, STG_INTERMODAL_322MSG_TBL.Activity_Date, STG_INTERMODAL_322MSG_TBL.Activity_Time, STG_INTERMODAL_322MSG_TBL.Sighting_Code;
    
    
    create table #Real (Equipment_Number varchar(10)
    				,Activity_Date varchar(6)
    				,Activity_Time varchar(4)
    				,Sighting_Code varchar(2)
    				,CountOfEquipment_Number int)
    insert into #Real
    SELECT [#None].Equipment_Number, 
    [#None].Activity_Date, 
    [#None].Activity_Time, 
    [#None].Sighting_Code, 
    Count([#None].Equipment_Number) AS CountOfEquipment_Number
    FROM [#None]
    GROUP BY [#None].Equipment_Number, [#None].Activity_Date, [#None].Activity_Time, [#None].Sighting_Code
    HAVING (((Count([#None].Equipment_Number))>1));
    
    
    SELECT STG_INTERMODAL_322MSG_TBL.*
    FROM [#Real] INNER JOIN STG_INTERMODAL_322MSG_TBL ON ([#Real].Equipment_Number = STG_INTERMODAL_322MSG_TBL.Equipment_Number) AND ([#Real].Activity_Date = STG_INTERMODAL_322MSG_TBL.Activity_Date) AND ([#Real].Activity_Time = STG_INTERMODAL_322MSG_TBL.Activity_Time) AND ([#Real].Sighting_Code = STG_INTERMODAL_322MSG_TBL.Sighting_Code)
    ORDER BY STG_INTERMODAL_322MSG_TBL.Equipment_Number, STG_INTERMODAL_322MSG_TBL.Activity_Date, STG_INTERMODAL_322MSG_TBL.Activity_Time, STG_INTERMODAL_322MSG_TBL.Sighting_Code;
    
    
    drop table #Duplicate_Records
    drop table #None
    drop table #Real',  @subject = '(scrbbususcnc01) Failure 322 Load' , @Attach_Results = true, @width = 3000, @Separator =  '|'
    any thoughts would be great.
    Jim

  2. #2
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    You forgot to post the error.

  3. #3
    Join Date
    Aug 2002
    Location
    Charlotte NC
    Posts
    665
    Originally posted by rdjabarov
    You forgot to post the error.
    No i didnt, the first think i said was the error
    failed with operating system error 32

    I have no idea what this means though.
    Jim

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •