Data Section in C #

I want to distribute a lot of data for different C # applications. For example, my table contains millions of records. I would like to point out that the first 3 million records are processed by App1 and the next 3 million in another C # App2 application and so on. Table rows are deleted and added as required. Now I want to write an SQL query that will process the first 3 million records. Now, if 5 records are deleted from application 1, then application 1 should select the next 5 records from app2 and app2 from app3. Thus, data always remains constant in every application.

I used the restriction in the SQL query, but I did not get the required output. How can I write an SQL query for this and how can I create a C # application.

+5
source share
3 answers

I would take a deeper understanding of the details of the application and process to get, select, delete, etc. However, to give him a chance for a decent answer.

In short, use partitioned tables and distributed views. Each application is β€œlinked” to these tables through a common split view, if any application must act on another table (or β€œkey”), it can use the same view and act in other tables.

More details ...

Enterprise Developer SQL Server , , ( "App1", "App2", "App3" ), , .

(WITH SCHEMABINDING) " Field1, Field2, Field3 .. 1 UNION Field1, Field2, Field3 .. 2 UNION Field1, Field2, Field3 .. 3"

/ , . , // , partitioncolumn = "app1" "id =?". , (//) .

, App1, "App1" WHERE, db 1, .

0

, , , . SQL LIMIT. . . , ( ).

, , , , , ( ).

, , , , , ( : ) POCOs. , ( ) .

/: , - , ?

+4

. 3 - .

An alternative approach would be to have an instance number column and have each instance of your backup application strings, as it needs them by writing its instance number to that column. If possible, process your data in smaller chunks.

Adding an index to the instance number column will allow you to calculate how many rows you have already processed and find the next batch of 1000 (for example) that has not yet been assigned to any instance.

+1
source

All Articles