I am working on a project for a client and going through the initial database design. The project will be a simple web app for tracking processes and their outcomes within a
Video memory, a very simple 2D matrix is stored as follows:
ABCD
EFGH
IJKL
in ram sequentially like an array as
A,B,C,D,E,F,G,H,I,J,K,L
element x,y can be found at array offset
[y*width+x]
for instance, x=2,y=2 (zero-based) refers to element K.
[y*width+x]=[2*4+2]=10. array element 10 (again zero-based) = K, so you're good.
Storing in a comma-delimited list will let you put a matrix of any size in an nvarchar field. This assumes that you don't need to query individual cells in SQL, but just grab the matrix as a whole and process it client-side.
Your table may look like this:
tbl_matrices
----
id
user_id
matrix nvarchar(max)