UPDATE [dtzrc_888].[dbo].[List_Subdivisions]
   SET [Depth] = 3 WHERE [Depth] = null
  
GO
我在企业管理器里想更新Depth字段里为空的设置成 数字 3 这断代码为什么不行?

解决方案 »

  1.   

    where isnull(depth,0)=0
    或者
    where depth is null
      

  2.   

    UPDATE [dtzrc_888].[dbo].[List_Subdivisions] 
      SET [Depth] = 3 WHERE [Depth] IS null 
      

  3.   

    在数据库中,不能用=号来判断NULL,要有IS NULLwhere isnull(depth,0)=0 
    或者 
    where depth is null1楼的第一句不对,
    如果楼主只是想更改NULL的,你这样就会把0的也更必了
      

  4.   

    UPDATE [dtzrc_888].[dbo].[List_Subdivisions] 
      SET [Depth] = 3 WHERE [Depth] is null 
      
    GO 
      

  5.   

    UPDATE [dtzrc_888].[dbo].[List_Subdivisions] 
      SET [Depth] = 3 WHERE Depth is  null 
      

  6.   

    列名 is null 如
    select * from student where score is null
    非空用 is not null 如
    select * from student where score is not null
      

  7.   

    UPDATE [dtzrc_888].[dbo].[List_Subdivisions] 
      SET [Depth] = 3 WHERE [Depth] is null 
      

  8.   

    路过建议看看PL SQL方面的书,这个是数据库基础的知识吧。
      

  9.   

    where isnull(depth,'null')='null' 
    或者 
    where depth is null 
      

  10.   

    判断为空的话: where depth is null
    不是空的话:   where depth is not null
      

  11.   


    UPDATE [dtzrc_888].[dbo].[List_Subdivisions] 
      SET [Depth] = 3 WHERE [Depth] IS null