Ways of getting User created tables.

vishalneeraj-24503
Posted by vishalneeraj-24503 under Sql Server category on | Points: 40 | Views : 241
There are so many ways of getting user related tables from Sql-Server.Here are the ways:-

1st Way using sysobjects in-built System Table:-
select [name] as úser created tables' from [dbo].[sysobjects]
where [xtype] = 'u' order by name;

2nd Way using Information_Schema in-built System Table:-
select [table_name] as úser created tables' from [information_schema].[tables]
where [table_type] = 'base table' order by table_name;

3rd Way using sp_tables in-built System Stored Procedure:-
exec sp_tables @table_type = "'table'";

Comments or Responses

Login to post response