Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.databases.ms-sqlserver > #1755
| From | Erland Sommarskog <esquel@sommarskog.se> |
|---|---|
| Newsgroups | comp.databases.ms-sqlserver |
| Subject | Re: load multiple txt files to sql server |
| Date | 2014-05-24 21:57 +0200 |
| Organization | Erland Sommarskog |
| Message-ID | <XnsA337DF5B97B3FYazorman@127.0.0.1> (permalink) |
| References | <a76c710f-76e8-4cfd-b098-9f0d3a2e5897@googlegroups.com> <XnsA3376359BB035Yazorman@127.0.0.1> <fbb48642-a3cf-4bc8-a7c0-f00722965b80@googlegroups.com> <25f5fd22-e8a7-4a0e-964e-f9a7652e04c6@googlegroups.com> |
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
Back to comp.databases.ms-sqlserver | Previous | Next — Previous in thread | Next in thread | Find similar
load multiple txt files to sql server tad na <teddybubu@gmail.com> - 2014-05-23 19:42 -0700
Re: load multiple txt files to sql server Erland Sommarskog <esquel@sommarskog.se> - 2014-05-24 09:45 +0200
Re: load multiple txt files to sql server bradbury9 <ray.bradbury9@gmail.com> - 2014-05-24 04:20 -0700
Re: load multiple txt files to sql server tad na <teddybubu@gmail.com> - 2014-05-24 09:32 -0700
Re: load multiple txt files to sql server Erland Sommarskog <esquel@sommarskog.se> - 2014-05-24 21:57 +0200
Re: load multiple txt files to sql server bradbury9 <ray.bradbury9@gmail.com> - 2014-05-25 03:21 -0700
Re: load multiple txt files to sql server rja.carnegie@gmail.com - 2014-05-24 15:30 -0700
Re: load multiple txt files to sql server tad na <teddybubu@gmail.com> - 2014-05-24 20:50 -0700
Re: load multiple txt files to sql server Erland Sommarskog <esquel@sommarskog.se> - 2014-05-25 11:16 +0200
csiph-web