2
Sort of....
The top portion goes in one table and the grid data goes in another table. And you will need to maintain the relation.
2
When you say S_no = Identity primary key, it cannot be 1, 1, 1, 2, 3, 3. It has to be 1, 2, 3, 4, 5, 6, etc.
2
I suggest two tables here. You may not think about it today, but tomorrow you will need them. See carefully.
table 1 : tblBill
BillNo - this is the primary key. Try NOT TO have two separate columns as sr no as pk and bill no as a separate column.
BillDate, Custoer Id, Tax amount, etc. You will have several columns which will go in header table.
BillNo BillDate, etc...
1
2
3
table 2 : tblBillDetail
BillDetailId - PK running id,
BillNo - FK to above table
BillDetailId 1 2 3 for a single bill. If i implement, I will NOT have it. Not required.
then you will have quantity, price, etc.
BillDetailId, BillNo, BillDetailId
1 1 1
2 1 2
3 1 3
4 2 1
5 2 2
6 2 3
7 3 1
1
like this