sql语句t_user和t_admin

版权声明: https://blog.csdn.net/eds124/article/details/85939233
--create database mydata;
--use mydata;
drop table t_user;
create table t_user(
	username nvarchar(10) not null default N'username',	unique(username),
	userpass nvarchar(10) not null default N'userpass',
	a1 bit not null default 0,
	a2 bit not null default 0,
	a3 bit not null default 0,
	a4 bit not null default 0,
	b1 bit not null default 0, 
	b2 bit not null default 0,
	b3 bit not null default 0,
	b4 bit not null default 0,
	c1 bit not null default 0,
	c2 bit not null default 0,
	c3 bit not null default 0,
	c4 bit not null default 0,
	d1 bit not null default 0,
	d2 bit not null default 0,
	d3 bit not null default 0,
	d4 bit not null default 0,
	usersmalldatetime smalldatetime not null default getdate(),
	p_userid uniqueidentifier not null default newid(),	primary key(p_userid)
);
insert into t_user (username, userpass) values (N'user', N'user');
insert into t_user (username, userpass) values (N'张三', N'zs123');
insert into t_user (username, userpass) values (N'李四', N'ls456');
insert into t_user (username) values (N'王五');
insert into t_user (userpass) values (N'666');

--预处理登陆select count(*) from t_user where username = @username and userpass = @userpass
select * from t_user order by username asc
drop table t_root;
create table t_root(
	rootname nvarchar(10) not null default N'rootname',	unique(rootname),
	rootpass nvarchar(10) not null default N'rootpass',
	rootsmalldatetime smalldatetime not null default getdate(),
	p_rootid uniqueidentifier not null default newid(),	primary key(p_rootid)
);
insert into t_root (rootname, rootpass) values (N'root', N'root');
insert into t_root (rootname, rootpass) values (N'admin', N'admin');
insert into t_root (rootname) values (N'aaaaaa');
insert into t_root (rootpass) values (N'passwd');
select * from t_root order by rootname asc

猜你喜欢

转载自blog.csdn.net/eds124/article/details/85939233