Select schema_name(tab.schema_id) + '.' + tab. ![]() If we want to show the structure of a database table or tables in the server then, we will use the SQL command DESCRIBE or other keyword DESC, which is identical to DESCRIBE one. ![]() (select schema_name(tab.schema_id) + '.' + tab.name as tab,įk.referenced_object_id as rel_object_id, SQL DESCRIBE TABLE is a SQL statement that is accountable for telling something about a specific table in the database. Summary article of FK queries for SQL Server.Ĭount(distinct rel_name) as relationships,Ĭount(distinct ref_name) as ,Ĭount(distinct rel_object_id) as related_tables,Ĭount(distinct referenced_object_id) as referenced_tables,Ĭount(distinct parent_object_id) as referencing_tables.Query below lists tables with most relationships (both foreign keys and FK references from other tables).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |