How to insert multiple data into mssql without using loop?
i'm developing a clinic management system, while doctor may give few medicines to patient,therefo re i hope inside my database,the data will look like
and now what i get is...
because i'm using store procedure and needed loop to store all "ItemID" into sql.
this is my 2 tables, i hope when storing data ,the recordID will not increase based on how many ItemID inserted.
i'm developing a clinic management system, while doctor may give few medicines to patient,therefo re i hope inside my database,the data will look like
Code:
|-----------------------------------| | RecordID | ItemID | Amount| |-----------------------------------| | 1 | 1 | 10 | | 1 | 2 | 100 | --------------------------------------
Code:
|-----------------------------------| | RecordID | ItemID | Amount| |-----------------------------------| | 1 | 1 | 10 | | 2 | 2 | 100 | --------------------------------------
Code:
+------------+ +-----------------+ | record | | record_items | +------------+ +-----------------+ |RecordID(PK)| > | RecordID (FK) | |PatientID | | ItemID | |Precription | | Amount | |VisitDate | +-----------------+ +------------+
Comment