Using SQL query to determine if a table exists

前端 未结 6 1862
清歌不尽
清歌不尽 2020-12-31 06:06

Guys is there any other way to determine a table exists other than below

  1. select count(*) from where rownum =1
  2. select
    6条回答
    •  旧时难觅i
      2020-12-31 06:46

      You can do this (in oracle, in mssql there is a bit different):

      select count(*)
      from all_objects
      where object_type in ('TABLE','VIEW')
      and object_name = 'your_table_name';
      

    提交回复
    热议问题