5> CREATE TABLE Shippers
6> (
7> ShipperID int IDENTITY NOT NULL
8> PRIMARY KEY,
9> ShipperName varchar(30) NOT NULL,
10> DateInSystem smalldatetime NOT NULL
11> DEFAULT GETDATE ()
12> )
13> GO
1>
2> CREATE TABLE Customers
3> (
4> CustomerNo int IDENTITY NOT NULL
5> PRIMARY KEY,
6> CustomerName varchar(30) NOT NULL,
7> Address1 varchar(30) NOT NULL,
8> Address2 varchar(30) NOT NULL,
9> City varchar(20) NOT NULL,
10> State char(2) NOT NULL,
11> Zip varchar(10) NOT NULL,
12> Contact varchar(25) NOT NULL,
13> Phone char(15) NOT NULL,
14> FedIDNo varchar(9) NOT NULL,
15> DateInSystem smalldatetime NOT NULL
16> )
17> GO
1>
2> ALTER TABLE Customers
3> ADD CONSTRAINT CN_CustomerDefaultDateInSystem
4> DEFAULT GETDATE() FOR DateInSystem
5> GO
1>
2> drop table Shippers;
3> drop table Customers;
4> GO
|