Thursday, September 30, 2010

copying text file values as a database column values

Step 1   :   create a table name as login...

Step 2   :

BULK INSERT login FROM 'c:\test_sql.txt' WITH
(
FIELDTERMINATOR = ',',--Data format in text file is username,password in a row.it is used to trminate the symbol comma and assume as a 2 column values

ROWTERMINATOR = '\n' )    --for next line
GO

--Showing the Result
SELECT *
FROM login
GO

No comments: