-1

i have one table i want to use one primary key in many row and not stop inputting row until i finished which is one transmittal_id equals to many rows of data

example table:transfer

(pk)transmittal_id (fk)product_id product_name product_quantity

i want a result table like this

example result table:transfer

transmittal_id product_id product_name product_quantity
220526 APCEE 100
220524 LAGUNDI 100
1 220529 TOVIT 100
220601 BETTER C 100
220605 ZINC VITA 100

1 Answers1

0

If TRANSMITTAL_ID column is a PK for the TRANSFER table therefore this one cannot contain NULL values. Transmittal_id column must contain unique values for every row of the table.

HRK
  • 336
  • 1
  • 2
  • 8
  • this is like a one id with many row table its not a null value its for example the table but you have a one id with multiple row data – user19162231 Jun 06 '22 at 18:58
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 06 '22 at 22:03
  • a primary key must have a unique value. Primary key uniquely identifies each record in a table. It looks like there are duplicate values if Transmittal_id is a PK. Тhe same value cannot be inserted for more than one row. Or the PK can consist more than one column (Example: Transmittal_id, Product_name and etc.). The value of these columns is combined to create a unique identifier. Or you can create an automatically generated number - SEQUENCE for the PK: https://learn.microsoft.com/en-us/sql/t-sql/statements/create-sequence-transact-sql?view=sql-server-ver16. – HRK Jun 07 '22 at 09:09