1. oracle only provides cascading deletion when creating tables, and sqlserver provides cascading deletion and update. Although the primary key value of the primary table cannot be modified frequently after the primary-foreign key relationship is established, this requirement is sometimes applied .) Oracle provides three options to set null, cascade, and do nothing when deleting oracle. In addition to the three options, SQL Server also provides default values.
2. oracle does NOT provide auto-increment of primary keys, which must be implemented using a sequence plus trigger. sqlserver provides auto-increment of primary keys [proId] [int] IDENTITY () not null, in the identity specification, the primary key is automatically generated after the incremental flag seed is set.
Add sequence:
Create sequence seq_depid
Minvalue 1
Max value 99999
Start with 1
Increment by 1
Nocache;
Trigger creation:
Create or replace trigger trg_depid
Before insert on dep
For each row
When (new. depid is null)
Begin
Select seq_depid.nextval into: new. depid from dual;
End trg_depid;
This article is from the "love IT" blog, please be sure to keep this source http://5563447.blog.51cto.com/5553447/1305044