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
This is described in books on line for BULK INSERT under the KEEPIDENTITY argument. Here is what is says
KEEPIDENTITY Specifies that the values for an identity column are present in the file imported. If KEEPIDENTITY is not given, the identity values for this column in the data file imported are ignored, and SQL Server automatically assigns unique values based on the seed and increment values specified during table creation. If the data file does not contain values for the identity column in the table or view, use a format file to specify that the identity column in the table or view should be skipped when importing data; SQL Server automatically assigns unique values for the column
So, either use a format file or supply a dummy value and make sure not to use the KEEPIDENTITY argument