Skip to content

Instantly share code, notes, and snippets.

@ngobach
Created April 18, 2016 17:31
Show Gist options
  • Save ngobach/86ef89efe8c5f117e32dd3495ed1d0df to your computer and use it in GitHub Desktop.
Save ngobach/86ef89efe8c5f117e32dd3495ed1d0df to your computer and use it in GitHub Desktop.
/*
Navicat SQL Server Data Transfer
Source Server : SQLSERVER
Source Server Version : 110000
Source Host : (local)\SQLEXPRESS:1433
Source Database : SinhVien
Source Schema : dbo
Target Server Type : SQL Server
Target Server Version : 110000
File Encoding : 65001
Date: 2016-04-19 00:31:19
*/
-- ----------------------------
-- Table structure for tblSinhVien
-- ----------------------------
DROP TABLE [tblSinhVien]
GO
CREATE TABLE [tblSinhVien] (
[MaSV] varchar(50) NOT NULL ,
[HoTen] nvarchar(50) NOT NULL ,
[NgaySinh] nchar(10) NOT NULL ,
[GioiTinh] nvarchar(50) NOT NULL ,
[QueQuan] nvarchar(50) NOT NULL ,
[Lop] nvarchar(50) NOT NULL ,
[Khoa] nvarchar(50) NOT NULL ,
[Email] nvarchar(50) NOT NULL ,
[DienThoai] varchar(15) NOT NULL
)
GO
-- ----------------------------
-- Records of tblSinhVien
-- ----------------------------
BEGIN TRANSACTION
GO
COMMIT TRANSACTION
GO
-- ----------------------------
-- Table structure for tblUser
-- ----------------------------
DROP TABLE [tblUser]
GO
CREATE TABLE [tblUser] (
[id] int NOT NULL IDENTITY(1,1) ,
[username] nvarchar(50) NOT NULL ,
[password] nvarchar(50) NOT NULL ,
[Email] nvarchar(50) NOT NULL ,
[fullname] nvarchar(50) NOT NULL
)
GO
DBCC CHECKIDENT(N'[tblUser]', RESEED, 1020)
GO
-- ----------------------------
-- Records of tblUser
-- ----------------------------
BEGIN TRANSACTION
GO
SET IDENTITY_INSERT [tblUser] ON
GO
INSERT INTO [tblUser] ([id], [username], [password], [Email], [fullname]) VALUES (N'1', N'admin', N'password', N'[email protected]', N'Ngo Xuan Bach'), (N'1019', N'ngobach', N'matkhau', N'[email protected]', N'Bach Ngo'), (N'1020', N'tranduc', N'123456', N'[email protected]', N'Tr?n Anh Ð?c')
GO
GO
SET IDENTITY_INSERT [tblUser] OFF
GO
COMMIT TRANSACTION
GO
-- ----------------------------
-- Procedure structure for KiemTraUser
-- ----------------------------
DROP PROCEDURE [KiemTraUser]
GO
CREATE PROCEDURE [KiemTraUser]
@username nvarchar(50),
@password nvarchar(50)
AS
BEGIN
SELECT * FROM tblUser WHERE [username]=@username AND [password]=@password
END
GO
-- ----------------------------
-- Indexes structure for table tblUser
-- ----------------------------
-- ----------------------------
-- Primary Key structure for table tblUser
-- ----------------------------
ALTER TABLE [tblUser] ADD PRIMARY KEY ([id])
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment