我称之为“SchoolRecords”一个数据库,我使用下面的代码创建一个表:表,但不承认
Create TABLE tblRoom (
ID nvarchar (2) Primary Key,
RoomType nvarchar (8),
Capacity numeric (3)
)
创建表,因为它出现在对象资源管理器中,但是当我尝试插入信息时,它会在表名称下方显示一条红线,当它悬停在它上面时,它会显示'无效的对象名称'tblRoom'。我的代码如下:
insert into tblRoom values ('B115[ca]','LT',100)
insert into tblRoom values ('B206[ca]','CL',36)
当exectuting代码出现此错误:
Msg 8152, Level 16, State 4, Line 1
String or binary data would be truncated.
The statement has been terminated.
解决您只需要更新您的智能感知缓存红色squigglies。 ctrl + shift + r –