创建测试数据库:
use master
CREATE DATABASE TestDB ON ( NAME='TestDB', FILENAME='D:databaseTestDB.mdf')
创建测试表:
USE TestDB
CREATE TABLE T_Employees
(EmpID VARCHAR(20) NOT null,
EmpName VARCHAR(20) null,
ChargID VARCHAR(20) null
PRIMARY KEY ( EmpID )
插入测试数据:
insert into T_Employees values
('1001','王明',NULL),
('1002','李怡',NULL),
('1003','张劲松','1001')