简体   繁体   中英

Database table (re)design. Combine multiple rows into one and assign primary key. Microsoft SQL Server

I have a problem with the way I've designed my tables currently.

What I am doing is dealing with CODA files (its a Belgian banking standard). I am saving every transaction into the table and I am assigning a GUID key for every transaction.

Now, every single line is NOT a transaction, but rather a group of lines together constitute one transaction. I have addressed this by generating a key for every transaction and storing it into the 2 tables below. I have linked this via a third table where this key is the primary key.

My superior has asked me to get rid off this third table and rather combine every transaction into a single row in each of the 2 tables shown below (NOT the third table, since that would be deleted).

I am new to developing on SQL Server and visual studio. Any help in this regard will be highly appreciated. Any ideas on this guys?

银行对帐单摘要

银行对帐单行

名称表

只是想在前进之前弄清楚,您是在试图将交易连接为(11 + 12 =(完成时的23值))还是对交易进行((完成时的(11,12)值))连接?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM