请帮忙查看一下哪里有问题了。谢谢~~
问:创建一个Employees1表,将Employees表的数据全部插入其中USE aa
GO
CREATE TABLE Employees1
( EmployeeID char(6) NOT NULL PRIMARY KEY,
Name char(10) NOT NULL,
Education char(4) NOT NULL,
Birthday date NOT NULL,
Sex bit NOT NULL DEFAULT 1,
WorkYear tinyint NULL,
Address varchar(40) NULL,
PhoneNumber char(12) NULL,
DepartmentID char(3) NOT NULL
)
GO
以上没有问题。
MERGE INTO Employee1
USING Employees ON Employee1.EmployeeID=Employees.EmployeeID
WHEN MATCHED
THEN UPDATE SET Employee1.Name=Employees.Name,Employee1.Education=Employees.Education,Employee1.Birthday=Employees.Birthday,Employee1.Sex=Employees.Sex,Employee1.WorkYear=Employees.WorkYear,Employee1.Address=Employees.Address,Employee1.PhoneNumber=Employees.PhoneNumber,Employee1.DepartmentID=Employees.DepartmentID
WHEN NOT MATCHED
THEN INSERT VALUES(Employees.EmployeeID,Employees.Name,Employees.Education,Employees.Birthday,Employees.Sex,Employees.WorkYear,Employees.Address,Employees.PhoneNumber,Employees.PhoneNumber)
WHEN NOT MATCHED BY SOURCE
THEN DELETE;
消息:消息 8152,级别 16,状态 14,第 1 行
将截断字符串或二进制数据。
语句已终止。