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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 foreign key

Author  Topic 

cvbkraju
Starting Member

2 Posts

Posted - 2008-02-12 : 11:22:13
Iam Creating a fact table on toad.
I want create a foreign key to that table.
Could any one help me how to write.
Thanks.

VENKAT

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2008-02-12 : 11:44:05
[code]
alter table [dbo].[MyTable]
add constraint [FK_MyTable_REF_MyOtherTable]
foreign key ( [MyOtherTable_ID] )
references [dbo].[MyOtherTable] ( [MyOtherTable_ID] )
[/code]

CODO ERGO SUM
Go to Top of Page
   

- Advertisement -