I have an asp.net / c# application that interfaces with the database only through stored procedures. I have tried doing this, but no luck.
I have a stored procedure “A” that returns (for example)… recordID & Description (1:Apple; 2:Banana; 3: Tomato)
I have another stored procedure “B” that returns (for example)… recordID & Description (1:Apple; 3: Tomato; 4:Grapes; 5:Oranges)
Using these stored procedure, I need to get B minus A (meaning I need to get “Grapes”, “Oranges” in my application.
I know how to call two stored procedures. But how would I store their value and eliminate the common records?
If you don’t expect those two stored procs to return large datasets then you can accomplish it in your ASP.NET code. Store the results of A in one collection (e.g. dataset) then store the results of B in another collection. And you can iterate through these two collections to eliminate duplicate records.
If, however, you do expect those stored procs to return and transmit large datasets across the wire, then you should consider doing what @Paddy suggests.