开发者

Consistency issue SQL Server

I have a central database. Applications sit on multiple servers and push data to the server.

Now, there is one scenario where in a string data which is longer than the maximum capacity of varchar. So, I split the strings and store them in consecutive rows.

The problem is when data is being pushed from servers s1, s2 (say) and data from s1 is d1 and s2 is d2

I split the data d1 into d11 and d12 and put in consecutive rows. But due to frequent updates, sometimes the updating of the table happens in this sequence d11, d21, d12, d22 instead of d11, d12, d21, d22 because I am handling the splitting in the application layer and not in the database layer.

Can anyone please recommend me a design workaround to handle this situation?

Than开发者_运维技巧ks


Use a different data type, like a CLOB. This will be able to store your entire string and so remove the need for splitting.

Each cell in your database should hold exactly one value, so try and avoid a fraction of that value and things will run much smoother!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜