Rajen

Untitled

Apr 23rd, 2012
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.87 KB | None | 0 0
  1. create table tmp.cesta
  2. (
  3. predchazejici_cesta varchar (200),
  4. pocet_dni varchar (50),
  5. id_cestovne int,
  6. id_zeme int,
  7. foreign key(id_cestovne) references tmp.cestovne (id_cestovne),
  8. foreign key(id_zeme) references tmp.zeme (id_zeme),
  9. constraint pk_cesta primary key (id_cestovne, id_zeme)
  10. )
  11.  
  12.  
  13. go --- nejede
  14. insert into tmp.cesta ( predchazejici_cesta, pocet_dni, id_cestovne, id_zeme)
  15. values ('Do Německa', 5, 1, 1)
  16. insert into tmp.cesta ( predchazejici_cesta, pocet_dni, id_cestovne, id_zeme)
  17. values ('Do Anglie', 10, 1, 1)
  18. insert into tmp.cesta ( predchazejici_cesta, pocet_dni, id_cestovne, id_zeme)
  19. values ('Do České Republiky', 50, 1, 1)
  20. insert into tmp.cesta ( predchazejici_cesta, pocet_dni, id_cestovne, id_zeme)
  21. values ('Do USA', 20 , 1, 1)
  22.  
  23. Cannot insert the value NULL into column 'id_zeme', table 'TEMPUS.tmp.cesta'; column does not allow nulls. INSERT fails.
Advertisement
Add Comment
Please, Sign In to add comment