日期:2014-05-20  浏览次数:20677 次

sqlServer2005数据库下 使用MVC模式,怎么让主键自增,SQL语句怎么写
这就是基础不好的悲剧

------解决方案--------------------
在数据库里面点击主键 里面有自动增加的属性 设置为是就可以了 和sql语句没关系
------解决方案--------------------
这是在数据库里面设置的好不.给你一个小例子
use master
go
if exists(select * from sysdatabases where name='db_test')
 drop database db_test
go
use db_test
go
if exists(select * from sysobjects where name='tb_table')
 drop table tb_table
go
create table tb_table(
 uid int primary key identity(1,1),--自增长
 uname varchar(20) not null,
 upwd varchar(20)
)