|
Posted by dwightsmail on 10/02/33 11:53
I am getting close to understanding that, but how do I take the
consequence and control table information with the hazard insert? Will
the related consequences be inserted with the 'Fog'?
Thank you for helping me
I dont want to have to enter the hazards 80 times if I can learn this
skill
:)
Erland Sommarskog wrote:
> (dwightsmail@gmail.com) writes:
> > What i want to know is if there is a relatively simple way of using a
> > query to populate the 10 hazards to each department, and to also
> > include the related table links, i dont mind renaming the departments
> > names to match each hazard, but i do not want to have to relink the
> > related tables manually
>
> INSERT Hazards(HazardID, Hazard, Department)
> VALUES (1, 'Fog', 'This Dept')
>
> Oh, so this won't work, because you have an IDENITY column, but it
> will be a lot easier if you don't have an IDENTITY.
>
> > Consequences
> > ----------------------
> > ConsequenceID - identity key field
> > HazardID - FK
> > Consequence - varchar
>
> If there can be more than once consequence per hazard, I think the key
> should be (HazardID, ConsequenceNo).
>
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
>
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|