Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
my code is that
SQL
create procedure sp_textupload
go
bulk insert tablename from 'D:\text.txt'
with
(rowterminator='\n',
field terminnator='|'
go
)


so here i found output is correct if the database table column mataches with the text field splitted with delimitor else
Else the scenario are

if database column < delimited txtfile
like Database column=> C1 C2 C3 and delimited textfile contents=> f1|f2|f3|f4
output=> f1 f2 f3|f4

but my expected result : f1 f2 f3 (Rejecting |f4 value)

like Database column=> C1 C2 C3 and delimited textfile contents=> f1|f2
f21|f22 (the next line of text)
output=> f1 f2f21 f22

but my expected result : f1 f2 NULL
f21 f22 Null
Posted
Updated 12-Nov-11 20:08pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900