My problem is not one of "Able to", but "able to quickly"
I have a table with a static number of rows for which multiple items per row need to be updated frequently. I'm doing this with .Net and SQL Server.
For testing, the table has around 5000 rows, 20 columns, and I'm updating 3 fields/columns per row every 5 seconds.
I've investigated some solutions but cannot get my update time to where I want (< 1 second):
- Performing 5000 SQL UPDATE commands: takes about 4 seconds
- Using a DataAdapter, Updating a DataTable, then performing a DataAdapter.Update: about 4 seconds (it just does multiple UPDATE commands like 1.)
- Using a large single UPDATE TABLE tablename col1 = CASE ... WHEN .... WHEN... : gives error "the query processor ran out of stack space...."
The goal is to take a bunch of data which is in memory and to persist it to a table so other applications or users can access this data. I assume there are effecient means to do this that I have not stumbled upon.
One restrictions is that I may not have access to the users SQL Server, so I'd like to do this programmatically in the .Net code using an UPDATE command or similar.