I have SQL Server Express 2008. How can I set a table's relations in it?
+1
A:
You need to install SQL Server Management Studio or run the SQL to create the FKs yourself.
Nate Bross
2010-09-14 16:19:19
I have to install SQL Server Management Studio 2008 ? or I can install 2005 version ?
Mohammad
2010-09-14 16:37:56
What ever version of DB server you have, your SSMS should match
Nate Bross
2010-09-14 16:51:08
Actually, SSMS 2008 works fine with previous versions (back to 2000 at least).
tdammers
2010-09-14 18:40:30
Thats true, but it doesn't work inversly. SSMS 2005 will not work for SQL Server 2008 for example.
Nate Bross
2010-09-14 19:05:26
+3
A:
You could run the ALTER TABLE statements necessary to add the foreign key relationships between tables either via:
- SQLCMD
- Management Studio
OMG Ponies
2010-09-14 16:23:51
+5
A:
Just like with any other database:
ALTER TABLE [tablename]
ADD CONSTRAINT [foreign_key_name]
FOREIGN KEY [local_column]
REFERENCES [foreign_table] ([foreign_column])
ON UPDATE RESTRICT
ON DELETE RESTRICT;
SQL Server Management Studio gives you a graphical UI to do the same thing through a click-and-point interface, but internally, it executes queries like these.
tdammers
2010-09-14 16:23:56