title: how to improve SQL query performance in my case
body: <p>I have a table, schema is very simple, an ID column as unique primary key (uniqueidentifier type) and some other nvarchar columns. My current goal is, for 5000 inputs, I need to calculate what ones are already contained in the table and what are not. Tht inputs are string and I have a C# function which converts string into uniqueidentifier (GUID). My logic is, if there is an existing ID, then I treat the string as already contained in the table.</p>
  
  <p>My question is, if I need to find out what ones from the 5000 input strings are already contained in DB, and what are not, what is the most efficient way?</p>
  
  <p>BTW: My current implementation is, convert string to GUID using C# code, then invoke/implement a store procedure which query whether an ID exists in database and returns back to C# code.</p>
  
  <p>My working environment: VSTS 2008 + SQL Server 2008 + C# 3.5.</p>