Home  >  Q&A  >  body text

How to determine whether the database libraries and tables exist?

As the question goes, how to determine whether the database libraries and tables exist?

正念的奇迹正念的奇迹2629 days ago1180

reply all(2)I'll reply

  • 大家讲道理

    大家讲道理2017-08-08 14:16:12

    if exists(select*from sysobjects where name ='bbsUsers' )
    drop table bbsUsers

    bbsUsers is the table to be queried

    sysobjects is the system table

    reply
    0
  • ringa_lee

    ringa_lee2017-08-08 14:15:49

    You have an operation to connect to the database in the program. If there is no table or library, there will be an error message

    reply
    0
  • Cancelreply