Showing posts with label sql txt file. Show all posts
Showing posts with label sql txt file. Show all posts

SQL Server: Insert records from .txt file

Thursday, June 3, 2010


CREATE TABLE geoip (
  start_ip CHAR(15) NOT NULL,
  end_ip CHAR(15) NOT NULL,
  start_long INT NOT NULL,
  end_long INT NOT NULL,
  country_code CHAR(2) NOT NULL,
  country_name VARCHAR(50) NOT NULL);


BULK INSERT geoip
 FROM 'd:\geoip.txt'
  WITH
  (
      FIELDTERMINATOR = ',',
      ROWTERMINATOR = '\n'
  )



Download 'geoip.txt' here

**************************LINKS******************************

I have created a new better blog:

My Youtube channel:

**************************LINKS******************************