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.
| Author |
Topic |
|
cathymomo
Starting Member
10 Posts |
Posted - 2009-03-03 : 15:32:55
|
create table BudgetItem(BINo integer not null,BIYear integer DEFAULT '2005' not null check (BIYear>=1900), BIAmt decimal DEFAULT '0' not null,BIActual decimal DEFAULT '0' not null,OrgNo integer not null,ECNo integer not null,PRIMARY KEY (BINo),FOREIGN KEY (OrgNo) REFERENCES OrgUnit(OrgNo),FOREIGN KEY (ECNo) REFERENCES ExpCat(ECNo));Hi, the above is my table and I must make the combination of BIYear, OrgNo and ECNo Unique. Any answers on how to do this will be grately appreciated!!!! |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
slimt_slimt
Aged Yak Warrior
746 Posts |
Posted - 2009-03-03 : 16:14:58
|
| since all three fields are numeric you can create primary key, but if you are planning to have milions of records in this table, i would recommend a primary key as identity column with integer type. You will have much faster results retrieving data from this table. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
|
|
|
|
|