A
Art
Hi folks,
I've got an app that retrieves a datatable from a third-party database
(the db is hosted by a partner company; we get the data via a web
service) containing around 100 rows of product SKUs.
I need to take those 100 SKUs, pass them to our SQL Server db to
determine which SKUs also exist in our database, then return a dataset
to the user which lists the full 100 SKUs, along with a 'yes/no' column
showing which SKUs exist in our db.
My question:
What's the fastest way to pass the 100 SKUs to our db and check to see
if each SKU exists in our db? I've seen various options which seem to
boil down to the following:
-- create a stored procedure that takes one SKU and checks our db; run
the SPROC 100 times;
OR
-- send the SKUs to the db in a comma-delimited string; have the sproc
parse the string and stick the SKUs in a temp table; check the db temp
table against the db;
Any thoughts on which of the above is faster? Easier? Is there another
method I should look at?
Thanks!
Art
I've got an app that retrieves a datatable from a third-party database
(the db is hosted by a partner company; we get the data via a web
service) containing around 100 rows of product SKUs.
I need to take those 100 SKUs, pass them to our SQL Server db to
determine which SKUs also exist in our database, then return a dataset
to the user which lists the full 100 SKUs, along with a 'yes/no' column
showing which SKUs exist in our db.
My question:
What's the fastest way to pass the 100 SKUs to our db and check to see
if each SKU exists in our db? I've seen various options which seem to
boil down to the following:
-- create a stored procedure that takes one SKU and checks our db; run
the SPROC 100 times;
OR
-- send the SKUs to the db in a comma-delimited string; have the sproc
parse the string and stick the SKUs in a temp table; check the db temp
table against the db;
Any thoughts on which of the above is faster? Easier? Is there another
method I should look at?
Thanks!
Art