create table T_(
ID numeric(18) identity,
UNAME Varchar(16) null,
PWD Varchar(16) null,
DATE datetime null,
constraint PK_T_ primary key (ID)
)
go
ID numeric(18) identity,
UNAME Varchar(16) null,
PWD Varchar(16) null,
DATE datetime null,
constraint PK_T_ primary key (ID)
)
go
(
id int NOT NULL IDENTITY (1, 1),
name varchar(10) NOT NULL,
password varchar(50) NULL,
[date] datetime NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE dbo.test7 ADD CONSTRAINT
DF_test7_date DEFAULT (getdate()) FOR [date]
GO
java.sql.SQLException: create table T_(ID numeric(18) identity,UNAME Varchar(16) null,PWD Varchar(16) null,DATE datetime null,constraint PK_T_ primary key (ID)) Don't understand SQL after: "create" Expected: "DEFAULT" found: "identity数据库连接正常。
你用什么数据库?
(
t_no int IDENTITY (1, 1) NOT NULL,
t_name varchar(15),
t_pass varchar(15),
t_date datetime default getdate()
)
不好意思,我也不知道是什么数据库,我申请了一个英文的jsp空间,那里只许用
sql语句操作数据库,估计是oracle
我用这条语句建立表是可以的。
create talbe table1
(name varchar(15),
pass varchar(15),
)
就是增加不了自动增长的整数型
ID numeric(18) identity,
UNAME Varchar(16) null,
PWD Varchar(16) null,
DATE_ datetime default getdate(),
constraint PK_T_ primary key (ID)
)
go试试