vb.net - How can I link values in a text file to values in a SQL Server table? -
update 2
essentially, i'd pass datatable sql server, not "create it", temporary thing using:
cmd.commandtext = "select * table1 inner join datatable on sample.name = datatable.name"
how can pass datatable vb.net (.net 2.0) sql server in similar fashion?
update 1
so i'm thinking maybe passing data text file datatable , using compare against sql server table? how go doing if @ possible?
original post
have table in sql server 2012 (i.e., dbo.sample1) within table there column contains names (i.e., abc01, abc02, abc03, hijk01, hijk02...)
i ran vb code extract file names without extension directory on machine (i.e., abc01, abc02...) met conditions, these file names saved on separate lines within text file.
is there easier convenient way of linking names on text file ones on table not show rows not on text file? figured can sit , plug in bunch of name = 'abc01'... didn't want site there , of names have. i'm not sure might work correctly need inner join on of 2 tables in db values in text file.
if long problem, please point me in right direction , can research , move forward it, appreciated, thanks!
if list of filenames reasonable can in() clause:
select * xxx name in ('abc01', 'abc02', 'abc03',...)
if list long bulk copy temp table use join.
Comments
Post a Comment