sql語句t_user帶許可權
阿新 • • 發佈:2019-01-08
--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'password', 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'張三', 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