Please start any new threads on our new 
    site at https://forums.sqlteam.com.  We've got lots of great SQL Server
    experts to answer whatever question you can come up with.
    
        
            
                
                    
                        
                            
                                | Author | 
                                
                                 Topic  | 
                             
                            
                                    | 
                                         ch9862 
                                        Yak Posting Veteran 
                                         
                                        
                                        76 Posts  | 
                                        
                                        
                                            
                                            
                                             Posted - 2012-03-22 : 08:33:04
                                            
  | 
                                             
                                            
                                            I have an SSIS package BULK INSERTing data from flat file into a view.  This has been working fine until recently.  Now I see the following error in the logs: quote: Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 1
  The only recent change I can think of is that some of the fields in the underlying table have been lengthened.  Types have not changed - only instead of nvarchar(50) there is nvarchar(150), etc.  Column 1 mentioned in the error message is the same (int).Could this change be the reason for the issue?  And if so - what do I ask our DBA to do to fix it?  Delete and recreate the view? | 
                                             
                                         
                                     | 
                             
       
                            
                       
                          
                            
                                    | 
                                     X002548 
                                    Not Just a Number 
                                     
                                    
                                    15586 Posts  | 
                                    
                                      
                                     | 
                                   
                            
                       
                          
                            
                                    | 
                                     ch9862 
                                    Yak Posting Veteran 
                                     
                                    
                                    76 Posts  | 
                                    
                                      
                                        
                                          
                                           
                                            Posted - 2012-03-23 : 09:40:13
                                          
  | 
                                         
                                        
                                          quote: Originally posted by X002548can you see the data?  open in notepad?
  Thanks for your help.In our case, the data arrives as XML, and the SSIS package verifies it, transforms to text and does bulk insert.  Something went wrong with the stylesheets and the files were encoded as ASCII instead of Unicode.  Took me a while to figure it out, I was focusing on the text itself  .quote: Originally posted by X002548I ALWAYS load my data to a staging table where the columns are varchar(max)...then do data audits
  I wish it was the case here, but our client's data analysts won't let us.  They require for all the data types and sizes to be the same in staging tables as they are in the tables downastream.We're yet to have a production issue as a result, but testers upstream sometimes enter very long data directly in the exported XML, and we have to explain bulk insert failures in ST environment.  Shrug.Thanks again!  | 
                                         
                                        
                                            | 
                                         
                                       
                                     | 
                                   
                            
                       
                          
                            
                                    | 
                                     X002548 
                                    Not Just a Number 
                                     
                                    
                                    15586 Posts  | 
                                    
                                      
                                     | 
                                   
                            
                            
                                | 
                                    
                                      
                                     
                                    
                                 | 
                             
                         
                     | 
                 
             
         |