SELECT TABLE_NAME, *
FROM INFORMATION_SCHEMA.TABLES
This works perfectly
Gave me the following information
TABLE_NAME | TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | TABLE_TYPE |
category | DBName | dbo | category | BASE TABLE |
Then, I tried the following
SELECT s.name + '.' + o.name as tableName
FROM sys.schemas s
JOIN sys.objects o ON s.schema_id = o.schema_id
WHERE o.type = 'U'
ORDER BY s.name, o.name
and it gave me the following
TABLE_NAME |
dbo.category |
Other possible types that can be used:
- C: Check constraint
- D: Default constraint
- F: Foreign Key constraint
- L: Log
- P: Stored procedure
- PK: Primary Key constraint
- RF: Replication Filter stored procedure
- S: System table
- TR: Trigger
- U: User table
- UQ: Unique constraint
- V: View
- X: Extended stored procedure
No comments:
Post a Comment