home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.ms-sqlserver      Notorious Rube Goldberg contraption      19,505 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 19,068 of 19,505   
   bradbury9 to All   
   Re: load multiple txt files to sql serve   
   25 May 14 03:21:53   
   
   From: ray.bradbury9@gmail.com   
      
   El sábado, 24 de mayo de 2014 21:57:24 UTC+2, Erland Sommarskog  escribió:   
   > tad na (teddybubu@gmail.com) writes:   
   >    
   > > All txt files have the same column structure so that is a big relief.    
   >    
   > > I like the idea of creating one table but the problem is each txt file   
   >    
   > > does not have a column with the country name.  How can I insert a new   
   >    
   > > column with the country name when importing to sql server?    
   >    
   > >    
   >    
   >    
   >    
   > The program that controls the load, would real the file and add the country    
   >    
   > name when inserting the rows. If you use BCP/BULK INSERT, you would have to    
   >    
   > change the default before each file.    
   >    
   >    
   >    
   > There are plenty of options available, and which one you chose is largely   
   >    
   > up to your skills. That is, if you know C#, you write a C# program. If    
   >    
   > you VBscript you do it VBscript etc.   
   >    
   >    
   >    
   > --    
   >    
   > Erland Sommarskog, Stockholm, esquel@sommarskog.se   
      
   If you want to do it just using sql server tools, go SSIS. If you dont mind   
   programming a bit, write a program. Depends on what you are more comfortable   
   with.   
      
   If you go the SSIS way, you will have to use the scripting task, loops, and   
   ssis variables. If you use a programming language you will work with same   
   tools plus it may be easier to debug/test (if you use decent programming tools   
   xD).    
      
   I am very familiar with programming cause I work as a developer and I like C#   
   a lot.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca