首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2EE开发 >

sqlServer2005数据库下 使用MVC模式,如何让主键自增,SQL语句如何写

2012-01-20 
sqlServer2005数据库下使用MVC模式,怎么让主键自增,SQL语句怎么写这就是基础不好的悲剧[解决办法]在数据库

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)
)

热点排行