Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I load data from a text file?

Status
Not open for further replies.

RufusCobb

Programmer
Sep 23, 2002
11
US
I need to load data from a text file into a table using SQL. Can anyone help me with the syntax? Basically, my table has 3 columns - uid, name, isactive. Is there a statment such as INSERT INTO <tablename> USING <filename> or anything like that? If so, how do I specify the path of the file? What kind of delimiters does my file need? Do column headings go in the file? Other special formatting? Thanks much in advance.

Scott
 
For a quick fix ... go into SQL Server Enterprise Manager and create the table, as you described. Once the table is built and saved, right-mouse click on it and choose &quot;All Tasks&quot; >> &quot;Import Data&quot;. You will set your source to the text file on your machine and then set the destination to your new table.

Drop a line if you need more guidence.

Thanks

J. Kusch
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top