[dba-VB] c# - manipulating datasets in memory

David McAfee davidmcafee at gmail.com
Fri Feb 19 13:33:25 CST 2010

Why not pass the seeds to a SPROC and call the sproc instead of the view?

CREATE PROCEDURE stpMySProc (@SeedName1, @SeedName2) AS
SELECT @SeedName1 AS SeedName1, @SeedName2 AS SeedName2, A.*
FROM vwMyView AS A

Now, instead of calling vwMyView, call stpMySproc.


On Fri, Feb 19, 2010 at 11:28 AM, jwcolby <jwcolby at colbyconsulting.com> wrote:
> I have written a C# fixed width file export for a specific purpose, exporting name / address orders
> for a client.
> The data comes from a specific view of a SQL Server order database.  I need to insert a small set of
> additional "seed names" in the result set.  For technical reasons I really want to do this as I am
> writing the file to disk.  IOW it would be good if I could pull the order names into a data reader,
> union the seed names, sort on zip and write the data reader out to disk (fixed width file).
> The fixed width writer code is written and functions just fine but ATM I am doing a klugy merge back
> in the database to get the seed names in before the writer ever gets the list of names to write.
> So...
> I know that supposedly .Net and SQL Server is all about disconnected recordsets and all of that.
> How would I go about pulling two datasets with the exact same fields (order and seed names) and then
> union them in memory before writing that union to file?
> Any ideas?
> --
> John W. Colby
> www.ColbyConsulting.com
> _______________________________________________
> dba-VB mailing list
> dba-VB at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-vb
> http://www.databaseadvisors.com

More information about the dba-VB mailing list