I have a very simple table with only one column (+ the key column). This column is a varchar(N) type. I would like to import data from a text file. The file looks like this:
string1
string2
.
.
.
stringZ
I don’t know how to generate a script to insert these values into the table. Or is there an even simplier tool to import in such a scenario?
Update: sorry I forgot that I have another column in this table and its value must be set to the same int for all rows.
Thanks for your help.
There are several approaches from writing your own little utilty to do it, to using BCP or other built in tools. Probably the easiest approach would be to use the Import Data wizard – in SSMS right click on the database you want to import into, choose Tasks and then Import Data.