我正在使用 SQL Server Management Studio 2008。
我想从一个视图中删除单个记录,该视图显示所有列的该记录中的空值。
我无法知道,从哪个表中我得到了这个空记录。
我检查了为视图连接的所有表,但没有一个表包含空记录。
谁能帮我从我的视图和所有相关表中删除这个空记录..?
因为我在许多其他页面中使用此视图,并且它在每个页面中都使用空值创建错误。
当我尝试从视图中删除此记录时,它显示如下错误
"Msg 4405, Level 16, State 1, Line 1
View or function 'viewGetProgressOverview' is not updatable because the modification affects multiple base tables."
Run Code Online (Sandbox Code Playgroud) 我在我的项目中使用Linq.
我想要来自viewTeachers的所有老师,其中Mailcode不等于20.
我的代码是
var startWithFullName = from v in Db.viewTeachers
where v.FullName.StartsWith(prefix) && !v.MailCode.Equals(20)
orderby v.FullName
select new { v.ID, v.FullName };
foreach (var teacher in startWithFullName)
{
teacherTable.Rows.Add(teacher.FullName, teacher.ID);
}
Run Code Online (Sandbox Code Playgroud)
我已经写了
!v.MailCode.Equals(20)
Run Code Online (Sandbox Code Playgroud)
但不确定它是否正确.
谁能告诉我怎么能这样做?