Suppose I have two tables:

Table1: Pets
PetID----------|Name----------|Type----------|
1              |Shaz          |Dog           |
2              |Molly         |Cat           |
3              |K9            |Dog           |
4              |Billy         |Goat          |
______________________________________________

Table 2:PetAttributes
PetID----------|AttributeName-|AttributeValue|
1              |HairColor     |Black         |
1              |Breed         |GermanShepherd|
1              |Age           |12            |
______________________________________________

As you can see from the sample, the pet attribute is linked to the PetId in the first table. For each pet, there are actually 28 attributenames each with a attributevalue. I need a faster and more efficient way of a)Inserting a new pet in the first table AND b) assigning their attributes in the second table. I'm often inserting 10-15 new pets at a time, making it incredibly tedious and mistake-prone activity when I'm writing up my SQL codes.

If anyone could help me, I'd be greatly appreciative.

Thanks in advance

Why not create insert script using some tool (best in EXCEL) and insert the parent record and then the dependent child record.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.