数据库中有一个系统表sysobjects,里面存储了数据库各个对象的信息。这里每个对象都有一个ID,这个表存储了表,存储过程,触发器,视图等相关信息

object_id: 就是根据对象名称返回该对象的id.
object_name:是根据对象id返回对象名称.

select object_id(对象名)
等同于:
select id from sysobjects where name=对象名

select object_name(id号)
等同于:
select name from sysobjects where id=id号

相关文章:

  • 2021-09-13
  • 2022-12-23
  • 2022-01-27
  • 2021-07-23
  • 2022-12-23
  • 2022-01-25
  • 2021-08-30
  • 2021-10-04
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-22
  • 2022-12-23
  • 2021-06-11
  • 2022-12-23
  • 2021-05-23
相关资源
相似解决方案