List names of all tables in a SQL Server 2012 schema



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








41















I have a schema in SQL Server 2012.



Is there a command that I can run in SQL to get the names of all the tables in that schema that were populated by user?



I know a similar query for MySQL SHOW TABLES; but this does not work with SQL Server.










share|improve this question
























  • What does "populated by user" mean? Its very ambiguous in this context.

    – RBarryYoung
    Jan 23 '14 at 15:44











  • possible duplicate of SQL statement to grab table names, views, and stored procs, order by schema

    – Charles Burns
    Jan 23 '14 at 15:52











  • What I meant by that was, some tables are created by the system and some are created by the code written and executed by the program for which the user is using the database. Sorry for being ambiguous. But I found the solution for my problem.

    – AnkitGarg43
    Jan 23 '14 at 15:52

















41















I have a schema in SQL Server 2012.



Is there a command that I can run in SQL to get the names of all the tables in that schema that were populated by user?



I know a similar query for MySQL SHOW TABLES; but this does not work with SQL Server.










share|improve this question
























  • What does "populated by user" mean? Its very ambiguous in this context.

    – RBarryYoung
    Jan 23 '14 at 15:44











  • possible duplicate of SQL statement to grab table names, views, and stored procs, order by schema

    – Charles Burns
    Jan 23 '14 at 15:52











  • What I meant by that was, some tables are created by the system and some are created by the code written and executed by the program for which the user is using the database. Sorry for being ambiguous. But I found the solution for my problem.

    – AnkitGarg43
    Jan 23 '14 at 15:52













41












41








41


6






I have a schema in SQL Server 2012.



Is there a command that I can run in SQL to get the names of all the tables in that schema that were populated by user?



I know a similar query for MySQL SHOW TABLES; but this does not work with SQL Server.










share|improve this question
















I have a schema in SQL Server 2012.



Is there a command that I can run in SQL to get the names of all the tables in that schema that were populated by user?



I know a similar query for MySQL SHOW TABLES; but this does not work with SQL Server.







sql sql-server






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 21 '15 at 19:51









acdcjunior

83.3k22195194




83.3k22195194










asked Jan 23 '14 at 15:21









AnkitGarg43AnkitGarg43

308137




308137












  • What does "populated by user" mean? Its very ambiguous in this context.

    – RBarryYoung
    Jan 23 '14 at 15:44











  • possible duplicate of SQL statement to grab table names, views, and stored procs, order by schema

    – Charles Burns
    Jan 23 '14 at 15:52











  • What I meant by that was, some tables are created by the system and some are created by the code written and executed by the program for which the user is using the database. Sorry for being ambiguous. But I found the solution for my problem.

    – AnkitGarg43
    Jan 23 '14 at 15:52

















  • What does "populated by user" mean? Its very ambiguous in this context.

    – RBarryYoung
    Jan 23 '14 at 15:44











  • possible duplicate of SQL statement to grab table names, views, and stored procs, order by schema

    – Charles Burns
    Jan 23 '14 at 15:52











  • What I meant by that was, some tables are created by the system and some are created by the code written and executed by the program for which the user is using the database. Sorry for being ambiguous. But I found the solution for my problem.

    – AnkitGarg43
    Jan 23 '14 at 15:52
















What does "populated by user" mean? Its very ambiguous in this context.

– RBarryYoung
Jan 23 '14 at 15:44





What does "populated by user" mean? Its very ambiguous in this context.

– RBarryYoung
Jan 23 '14 at 15:44













possible duplicate of SQL statement to grab table names, views, and stored procs, order by schema

– Charles Burns
Jan 23 '14 at 15:52





possible duplicate of SQL statement to grab table names, views, and stored procs, order by schema

– Charles Burns
Jan 23 '14 at 15:52













What I meant by that was, some tables are created by the system and some are created by the code written and executed by the program for which the user is using the database. Sorry for being ambiguous. But I found the solution for my problem.

– AnkitGarg43
Jan 23 '14 at 15:52





What I meant by that was, some tables are created by the system and some are created by the code written and executed by the program for which the user is using the database. Sorry for being ambiguous. But I found the solution for my problem.

– AnkitGarg43
Jan 23 '14 at 15:52












6 Answers
6






active

oldest

votes


















64














Your should really use the INFORMATION_SCHEMA views in your database:



USE <your_database_name>
GO
SELECT * FROM INFORMATION_SCHEMA.TABLES


You can then filter that by table schema and/or table type, e.g.



SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'





share|improve this answer


















  • 2





    Meh, while standard and portable, I recommend against INFORMATION_SCHEMA, mostly because they're incomplete: sqlblog.com/blogs/aaron_bertrand/archive/2011/11/03/…

    – Aaron Bertrand
    Jan 23 '14 at 15:30











  • @AaronBertrand - you have a point, I use them up to the point I can't, then spelunk the system tables.

    – Kev
    Jan 23 '14 at 15:34











  • see and I don't see the point of that. Why use something when inevitably you'll need to switch gears? If you start with the catalog views, you don't have to change tactics when you come across something that INFORMATION_SCHEMA doesn't bother to cover. Kind of like having a cheese allergy, but eating cheese until it makes you sick. I'd rather just pretend that cheese (and INFORMATION_SCHEMA) doesn't exist.

    – Aaron Bertrand
    Jan 23 '14 at 15:35



















31














SELECT t.name 
FROM sys.tables AS t
INNER JOIN sys.schemas AS s
ON t.[schema_id] = s.[schema_id]
WHERE s.name = N'schema_name';





share|improve this answer























  • This does not limit to tables 'populated by user'.

    – jtimperley
    Jan 23 '14 at 15:27











  • @jtimperley Well, I assumed "populated by user" was in reference to tables created by a user using a specific schema. In any case, what system tables do you see returned by this query? If you enable diagram support, is_ms_shipped is 0 for sysdiagrams, so your filter doesn't exclude it either.

    – Aaron Bertrand
    Jan 23 '14 at 15:27












  • (Not that sysdiagrams or any other system tables added, e.g. systranschemas which is created when CDC support is added, would match any schema other than dbo anyway.)

    – Aaron Bertrand
    Jan 23 '14 at 15:33


















9














SQL Server 2005, 2008, 2012 or 2014:



SELECT * FROM information_schema.tables WHERE TABLE_TYPE='BASE TABLE' AND TABLE_SCHEMA = 'dbo'


For more details:
How do I get list of all tables in a database using TSQL?






share|improve this answer
































    3














    SELECT t1.name AS [Schema], t2.name AS [Table]
    FROM sys.schemas t1
    INNER JOIN sys.tables t2
    ON t2.schema_id = t1.schema_id
    ORDER BY t1.name,t2.name





    share|improve this answer






























      1














      SELECT *
      FROM sys.tables t
      INNER JOIN sys.objects o on o.object_id = t.object_id
      WHERE o.is_ms_shipped = 0;





      share|improve this answer























      • You should be able to run it just like that but you're free to make whatever changed needed. :) Filter outputted columns, add extra filters, derive table sizes, whatever.

        – jtimperley
        Jan 23 '14 at 15:25











      • This does not limit the results to a specific schema.

        – Aaron Bertrand
        Jan 23 '14 at 15:25


















      0














      select * from [schema_name].sys.tables


      This should work. Make sure you are on the server which consists of your "[schema_name]"






      share|improve this answer

























        Your Answer






        StackExchange.ifUsing("editor", function ()
        StackExchange.using("externalEditor", function ()
        StackExchange.using("snippets", function ()
        StackExchange.snippets.init();
        );
        );
        , "code-snippets");

        StackExchange.ready(function()
        var channelOptions =
        tags: "".split(" "),
        id: "1"
        ;
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function()
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled)
        StackExchange.using("snippets", function()
        createEditor();
        );

        else
        createEditor();

        );

        function createEditor()
        StackExchange.prepareEditor(
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader:
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        ,
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        );



        );













        draft saved

        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f21312331%2flist-names-of-all-tables-in-a-sql-server-2012-schema%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown

























        6 Answers
        6






        active

        oldest

        votes








        6 Answers
        6






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        64














        Your should really use the INFORMATION_SCHEMA views in your database:



        USE <your_database_name>
        GO
        SELECT * FROM INFORMATION_SCHEMA.TABLES


        You can then filter that by table schema and/or table type, e.g.



        SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'





        share|improve this answer


















        • 2





          Meh, while standard and portable, I recommend against INFORMATION_SCHEMA, mostly because they're incomplete: sqlblog.com/blogs/aaron_bertrand/archive/2011/11/03/…

          – Aaron Bertrand
          Jan 23 '14 at 15:30











        • @AaronBertrand - you have a point, I use them up to the point I can't, then spelunk the system tables.

          – Kev
          Jan 23 '14 at 15:34











        • see and I don't see the point of that. Why use something when inevitably you'll need to switch gears? If you start with the catalog views, you don't have to change tactics when you come across something that INFORMATION_SCHEMA doesn't bother to cover. Kind of like having a cheese allergy, but eating cheese until it makes you sick. I'd rather just pretend that cheese (and INFORMATION_SCHEMA) doesn't exist.

          – Aaron Bertrand
          Jan 23 '14 at 15:35
















        64














        Your should really use the INFORMATION_SCHEMA views in your database:



        USE <your_database_name>
        GO
        SELECT * FROM INFORMATION_SCHEMA.TABLES


        You can then filter that by table schema and/or table type, e.g.



        SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'





        share|improve this answer


















        • 2





          Meh, while standard and portable, I recommend against INFORMATION_SCHEMA, mostly because they're incomplete: sqlblog.com/blogs/aaron_bertrand/archive/2011/11/03/…

          – Aaron Bertrand
          Jan 23 '14 at 15:30











        • @AaronBertrand - you have a point, I use them up to the point I can't, then spelunk the system tables.

          – Kev
          Jan 23 '14 at 15:34











        • see and I don't see the point of that. Why use something when inevitably you'll need to switch gears? If you start with the catalog views, you don't have to change tactics when you come across something that INFORMATION_SCHEMA doesn't bother to cover. Kind of like having a cheese allergy, but eating cheese until it makes you sick. I'd rather just pretend that cheese (and INFORMATION_SCHEMA) doesn't exist.

          – Aaron Bertrand
          Jan 23 '14 at 15:35














        64












        64








        64







        Your should really use the INFORMATION_SCHEMA views in your database:



        USE <your_database_name>
        GO
        SELECT * FROM INFORMATION_SCHEMA.TABLES


        You can then filter that by table schema and/or table type, e.g.



        SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'





        share|improve this answer













        Your should really use the INFORMATION_SCHEMA views in your database:



        USE <your_database_name>
        GO
        SELECT * FROM INFORMATION_SCHEMA.TABLES


        You can then filter that by table schema and/or table type, e.g.



        SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 23 '14 at 15:28









        KevKev

        98.3k45266356




        98.3k45266356







        • 2





          Meh, while standard and portable, I recommend against INFORMATION_SCHEMA, mostly because they're incomplete: sqlblog.com/blogs/aaron_bertrand/archive/2011/11/03/…

          – Aaron Bertrand
          Jan 23 '14 at 15:30











        • @AaronBertrand - you have a point, I use them up to the point I can't, then spelunk the system tables.

          – Kev
          Jan 23 '14 at 15:34











        • see and I don't see the point of that. Why use something when inevitably you'll need to switch gears? If you start with the catalog views, you don't have to change tactics when you come across something that INFORMATION_SCHEMA doesn't bother to cover. Kind of like having a cheese allergy, but eating cheese until it makes you sick. I'd rather just pretend that cheese (and INFORMATION_SCHEMA) doesn't exist.

          – Aaron Bertrand
          Jan 23 '14 at 15:35













        • 2





          Meh, while standard and portable, I recommend against INFORMATION_SCHEMA, mostly because they're incomplete: sqlblog.com/blogs/aaron_bertrand/archive/2011/11/03/…

          – Aaron Bertrand
          Jan 23 '14 at 15:30











        • @AaronBertrand - you have a point, I use them up to the point I can't, then spelunk the system tables.

          – Kev
          Jan 23 '14 at 15:34











        • see and I don't see the point of that. Why use something when inevitably you'll need to switch gears? If you start with the catalog views, you don't have to change tactics when you come across something that INFORMATION_SCHEMA doesn't bother to cover. Kind of like having a cheese allergy, but eating cheese until it makes you sick. I'd rather just pretend that cheese (and INFORMATION_SCHEMA) doesn't exist.

          – Aaron Bertrand
          Jan 23 '14 at 15:35








        2




        2





        Meh, while standard and portable, I recommend against INFORMATION_SCHEMA, mostly because they're incomplete: sqlblog.com/blogs/aaron_bertrand/archive/2011/11/03/…

        – Aaron Bertrand
        Jan 23 '14 at 15:30





        Meh, while standard and portable, I recommend against INFORMATION_SCHEMA, mostly because they're incomplete: sqlblog.com/blogs/aaron_bertrand/archive/2011/11/03/…

        – Aaron Bertrand
        Jan 23 '14 at 15:30













        @AaronBertrand - you have a point, I use them up to the point I can't, then spelunk the system tables.

        – Kev
        Jan 23 '14 at 15:34





        @AaronBertrand - you have a point, I use them up to the point I can't, then spelunk the system tables.

        – Kev
        Jan 23 '14 at 15:34













        see and I don't see the point of that. Why use something when inevitably you'll need to switch gears? If you start with the catalog views, you don't have to change tactics when you come across something that INFORMATION_SCHEMA doesn't bother to cover. Kind of like having a cheese allergy, but eating cheese until it makes you sick. I'd rather just pretend that cheese (and INFORMATION_SCHEMA) doesn't exist.

        – Aaron Bertrand
        Jan 23 '14 at 15:35






        see and I don't see the point of that. Why use something when inevitably you'll need to switch gears? If you start with the catalog views, you don't have to change tactics when you come across something that INFORMATION_SCHEMA doesn't bother to cover. Kind of like having a cheese allergy, but eating cheese until it makes you sick. I'd rather just pretend that cheese (and INFORMATION_SCHEMA) doesn't exist.

        – Aaron Bertrand
        Jan 23 '14 at 15:35














        31














        SELECT t.name 
        FROM sys.tables AS t
        INNER JOIN sys.schemas AS s
        ON t.[schema_id] = s.[schema_id]
        WHERE s.name = N'schema_name';





        share|improve this answer























        • This does not limit to tables 'populated by user'.

          – jtimperley
          Jan 23 '14 at 15:27











        • @jtimperley Well, I assumed "populated by user" was in reference to tables created by a user using a specific schema. In any case, what system tables do you see returned by this query? If you enable diagram support, is_ms_shipped is 0 for sysdiagrams, so your filter doesn't exclude it either.

          – Aaron Bertrand
          Jan 23 '14 at 15:27












        • (Not that sysdiagrams or any other system tables added, e.g. systranschemas which is created when CDC support is added, would match any schema other than dbo anyway.)

          – Aaron Bertrand
          Jan 23 '14 at 15:33















        31














        SELECT t.name 
        FROM sys.tables AS t
        INNER JOIN sys.schemas AS s
        ON t.[schema_id] = s.[schema_id]
        WHERE s.name = N'schema_name';





        share|improve this answer























        • This does not limit to tables 'populated by user'.

          – jtimperley
          Jan 23 '14 at 15:27











        • @jtimperley Well, I assumed "populated by user" was in reference to tables created by a user using a specific schema. In any case, what system tables do you see returned by this query? If you enable diagram support, is_ms_shipped is 0 for sysdiagrams, so your filter doesn't exclude it either.

          – Aaron Bertrand
          Jan 23 '14 at 15:27












        • (Not that sysdiagrams or any other system tables added, e.g. systranschemas which is created when CDC support is added, would match any schema other than dbo anyway.)

          – Aaron Bertrand
          Jan 23 '14 at 15:33













        31












        31








        31







        SELECT t.name 
        FROM sys.tables AS t
        INNER JOIN sys.schemas AS s
        ON t.[schema_id] = s.[schema_id]
        WHERE s.name = N'schema_name';





        share|improve this answer













        SELECT t.name 
        FROM sys.tables AS t
        INNER JOIN sys.schemas AS s
        ON t.[schema_id] = s.[schema_id]
        WHERE s.name = N'schema_name';






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 23 '14 at 15:23









        Aaron BertrandAaron Bertrand

        213k27372410




        213k27372410












        • This does not limit to tables 'populated by user'.

          – jtimperley
          Jan 23 '14 at 15:27











        • @jtimperley Well, I assumed "populated by user" was in reference to tables created by a user using a specific schema. In any case, what system tables do you see returned by this query? If you enable diagram support, is_ms_shipped is 0 for sysdiagrams, so your filter doesn't exclude it either.

          – Aaron Bertrand
          Jan 23 '14 at 15:27












        • (Not that sysdiagrams or any other system tables added, e.g. systranschemas which is created when CDC support is added, would match any schema other than dbo anyway.)

          – Aaron Bertrand
          Jan 23 '14 at 15:33

















        • This does not limit to tables 'populated by user'.

          – jtimperley
          Jan 23 '14 at 15:27











        • @jtimperley Well, I assumed "populated by user" was in reference to tables created by a user using a specific schema. In any case, what system tables do you see returned by this query? If you enable diagram support, is_ms_shipped is 0 for sysdiagrams, so your filter doesn't exclude it either.

          – Aaron Bertrand
          Jan 23 '14 at 15:27












        • (Not that sysdiagrams or any other system tables added, e.g. systranschemas which is created when CDC support is added, would match any schema other than dbo anyway.)

          – Aaron Bertrand
          Jan 23 '14 at 15:33
















        This does not limit to tables 'populated by user'.

        – jtimperley
        Jan 23 '14 at 15:27





        This does not limit to tables 'populated by user'.

        – jtimperley
        Jan 23 '14 at 15:27













        @jtimperley Well, I assumed "populated by user" was in reference to tables created by a user using a specific schema. In any case, what system tables do you see returned by this query? If you enable diagram support, is_ms_shipped is 0 for sysdiagrams, so your filter doesn't exclude it either.

        – Aaron Bertrand
        Jan 23 '14 at 15:27






        @jtimperley Well, I assumed "populated by user" was in reference to tables created by a user using a specific schema. In any case, what system tables do you see returned by this query? If you enable diagram support, is_ms_shipped is 0 for sysdiagrams, so your filter doesn't exclude it either.

        – Aaron Bertrand
        Jan 23 '14 at 15:27














        (Not that sysdiagrams or any other system tables added, e.g. systranschemas which is created when CDC support is added, would match any schema other than dbo anyway.)

        – Aaron Bertrand
        Jan 23 '14 at 15:33





        (Not that sysdiagrams or any other system tables added, e.g. systranschemas which is created when CDC support is added, would match any schema other than dbo anyway.)

        – Aaron Bertrand
        Jan 23 '14 at 15:33











        9














        SQL Server 2005, 2008, 2012 or 2014:



        SELECT * FROM information_schema.tables WHERE TABLE_TYPE='BASE TABLE' AND TABLE_SCHEMA = 'dbo'


        For more details:
        How do I get list of all tables in a database using TSQL?






        share|improve this answer





























          9














          SQL Server 2005, 2008, 2012 or 2014:



          SELECT * FROM information_schema.tables WHERE TABLE_TYPE='BASE TABLE' AND TABLE_SCHEMA = 'dbo'


          For more details:
          How do I get list of all tables in a database using TSQL?






          share|improve this answer



























            9












            9








            9







            SQL Server 2005, 2008, 2012 or 2014:



            SELECT * FROM information_schema.tables WHERE TABLE_TYPE='BASE TABLE' AND TABLE_SCHEMA = 'dbo'


            For more details:
            How do I get list of all tables in a database using TSQL?






            share|improve this answer















            SQL Server 2005, 2008, 2012 or 2014:



            SELECT * FROM information_schema.tables WHERE TABLE_TYPE='BASE TABLE' AND TABLE_SCHEMA = 'dbo'


            For more details:
            How do I get list of all tables in a database using TSQL?







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited May 23 '17 at 11:46









            Community

            11




            11










            answered Oct 27 '16 at 1:14









            NandoviskiNandoviski

            155111




            155111





















                3














                SELECT t1.name AS [Schema], t2.name AS [Table]
                FROM sys.schemas t1
                INNER JOIN sys.tables t2
                ON t2.schema_id = t1.schema_id
                ORDER BY t1.name,t2.name





                share|improve this answer



























                  3














                  SELECT t1.name AS [Schema], t2.name AS [Table]
                  FROM sys.schemas t1
                  INNER JOIN sys.tables t2
                  ON t2.schema_id = t1.schema_id
                  ORDER BY t1.name,t2.name





                  share|improve this answer

























                    3












                    3








                    3







                    SELECT t1.name AS [Schema], t2.name AS [Table]
                    FROM sys.schemas t1
                    INNER JOIN sys.tables t2
                    ON t2.schema_id = t1.schema_id
                    ORDER BY t1.name,t2.name





                    share|improve this answer













                    SELECT t1.name AS [Schema], t2.name AS [Table]
                    FROM sys.schemas t1
                    INNER JOIN sys.tables t2
                    ON t2.schema_id = t1.schema_id
                    ORDER BY t1.name,t2.name






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Jul 10 '17 at 20:50









                    Lorena PitaLorena Pita

                    697814




                    697814





















                        1














                        SELECT *
                        FROM sys.tables t
                        INNER JOIN sys.objects o on o.object_id = t.object_id
                        WHERE o.is_ms_shipped = 0;





                        share|improve this answer























                        • You should be able to run it just like that but you're free to make whatever changed needed. :) Filter outputted columns, add extra filters, derive table sizes, whatever.

                          – jtimperley
                          Jan 23 '14 at 15:25











                        • This does not limit the results to a specific schema.

                          – Aaron Bertrand
                          Jan 23 '14 at 15:25















                        1














                        SELECT *
                        FROM sys.tables t
                        INNER JOIN sys.objects o on o.object_id = t.object_id
                        WHERE o.is_ms_shipped = 0;





                        share|improve this answer























                        • You should be able to run it just like that but you're free to make whatever changed needed. :) Filter outputted columns, add extra filters, derive table sizes, whatever.

                          – jtimperley
                          Jan 23 '14 at 15:25











                        • This does not limit the results to a specific schema.

                          – Aaron Bertrand
                          Jan 23 '14 at 15:25













                        1












                        1








                        1







                        SELECT *
                        FROM sys.tables t
                        INNER JOIN sys.objects o on o.object_id = t.object_id
                        WHERE o.is_ms_shipped = 0;





                        share|improve this answer













                        SELECT *
                        FROM sys.tables t
                        INNER JOIN sys.objects o on o.object_id = t.object_id
                        WHERE o.is_ms_shipped = 0;






                        share|improve this answer












                        share|improve this answer



                        share|improve this answer










                        answered Jan 23 '14 at 15:23









                        jtimperleyjtimperley

                        2,26479




                        2,26479












                        • You should be able to run it just like that but you're free to make whatever changed needed. :) Filter outputted columns, add extra filters, derive table sizes, whatever.

                          – jtimperley
                          Jan 23 '14 at 15:25











                        • This does not limit the results to a specific schema.

                          – Aaron Bertrand
                          Jan 23 '14 at 15:25

















                        • You should be able to run it just like that but you're free to make whatever changed needed. :) Filter outputted columns, add extra filters, derive table sizes, whatever.

                          – jtimperley
                          Jan 23 '14 at 15:25











                        • This does not limit the results to a specific schema.

                          – Aaron Bertrand
                          Jan 23 '14 at 15:25
















                        You should be able to run it just like that but you're free to make whatever changed needed. :) Filter outputted columns, add extra filters, derive table sizes, whatever.

                        – jtimperley
                        Jan 23 '14 at 15:25





                        You should be able to run it just like that but you're free to make whatever changed needed. :) Filter outputted columns, add extra filters, derive table sizes, whatever.

                        – jtimperley
                        Jan 23 '14 at 15:25













                        This does not limit the results to a specific schema.

                        – Aaron Bertrand
                        Jan 23 '14 at 15:25





                        This does not limit the results to a specific schema.

                        – Aaron Bertrand
                        Jan 23 '14 at 15:25











                        0














                        select * from [schema_name].sys.tables


                        This should work. Make sure you are on the server which consists of your "[schema_name]"






                        share|improve this answer





























                          0














                          select * from [schema_name].sys.tables


                          This should work. Make sure you are on the server which consists of your "[schema_name]"






                          share|improve this answer



























                            0












                            0








                            0







                            select * from [schema_name].sys.tables


                            This should work. Make sure you are on the server which consists of your "[schema_name]"






                            share|improve this answer















                            select * from [schema_name].sys.tables


                            This should work. Make sure you are on the server which consists of your "[schema_name]"







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Nov 15 '18 at 12:11









                            suvojit_007

                            1,3372618




                            1,3372618










                            answered Nov 15 '18 at 11:27









                            Saman KapaliSaman Kapali

                            11




                            11



























                                draft saved

                                draft discarded
















































                                Thanks for contributing an answer to Stack Overflow!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid


                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.

                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f21312331%2flist-names-of-all-tables-in-a-sql-server-2012-schema%23new-answer', 'question_page');

                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                Use pre created SQLite database for Android project in kotlin

                                Darth Vader #20

                                Ondo