File Test.txt contain 3 rows
1,2
3,4
5,6
We can import these rows into a table by using these scripts.
CREATE TABLE dbo.tblTest(a int, b int)
GO
BULK INSERT dbo.tblTest
FROM 'D:\Temp\Test.txt'
WITH(FIELDTERMINATOR =',',
ROWTERMINATOR ='\n')
Sunday, December 13, 2009
Import data from a text file to a table
at 2:59 AM
Labels: SQL Server, SQL Server Tip
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment