Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Primerys Keys and foregein keys in various tables

Author  Topic 

marial82
Starting Member

1 Post

Posted - 2012-01-04 : 09:32:39
hello there, i just started to learn SQL so i find a very good videotutorial wich explain very good everything .. so to be more easy for me i create in a XE the same tables with same structure for tutorials, so i create manually all tables for the screenshot with data and fine., but right now i need to define the relacion of the tables with PK and FK ., this is the screenshot http://imageshack.us/photo/my-images/850/mapza.png/

so i am unable to go with my tutorials beacuse now the querys are with relacional tables

i put here the name of each table to be more easy

- COMPANIAS_DE_ENVIOS

- PEDIDOS

- EMPLEADOS

- PROVEDOREES

- CLIENTES

- DETALLES DE PEDIDOS

- CATEGORIAS

- PRODUCTOS

EDIT .. i don't now if i explain good what i need., i need to put the keys for the tables of the screenshot, thnk you and happy new year!

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-01-04 : 12:20:22
you need to use ALTER TABLE <tablename> ADD CONSTRAINT.... for that

http://msdn.microsoft.com/en-us/library/ms190273.aspx



------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -