Thread: Bulk Insert
View Single Post
  #6 (permalink)  
Old December 11th, 2007, 05:23 PM
SQLScott's Avatar
SQLScott SQLScott is offline
Wrox Author
Points: 1,121, Level: 13
Points: 1,121, Level: 13 Points: 1,121, Level: 13 Points: 1,121, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2004
Location: Wellington, FL , USA.
Posts: 338
Thanks: 0
Thanked 1 Time in 1 Post
Default

Here is your answer:

File:
John Greed
Kevin Heath

CREATE TABLE Names
(
  Firstname varchar(20),
    LastName varchar(20)
)

BULK INSERT Names FROM 'c:\names.txt' WITH (FIELDTERMINATOR = ' ')

select * from Names

drop table Names

========================
Scott Klein
Author of:
Professional SQL Server 2005 XML
Professional WCF Programming: .NET Development with the Windows Communication Foundation
Professional LINQ
========================
Reply With Quote