How to get table list in database, using MS SQL 2008?

后端 未结 3 511
感动是毒
感动是毒 2021-02-06 23:05

I want to verify if a table exists in a database, and if it doesn\'t exist, to create it. How can I get a list of all the tables in the current database?

I could get the

3条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-06 23:19

    This query will get you all the tables in the database

    USE [DatabaseName];
    
    SELECT * FROM information_schema.tables;
    

提交回复
热议问题