I want to import a one column text file into one of my sql tables. The file is just a list of swear words.
I\'ve written the following TSQL to do this
In SQL Server 2008 I've found it easier to just create a file containing a lot of inserts like so, and paste that into Management Studio's query window, rather than fight with getting the format file and bulk insert file permissions just right:
USE YourDB
GO
INSERT INTO MyTable (FirstCol, SecondCol)
VALUES ('First',1),
('Second',2),
('Third',3),
('Fourth',4),
('Fifth',5)
http://blog.sqlauthority.com/2008/07/02/sql-server-2008-insert-multiple-records-using-one-insert-statement-use-of-row-constructor/