Desc Query in Mssql Similar to Mysql

This query imitate the desc operation from mysql into mssql. It produces the columns and descriptions of the Products table from the Northwind database.


SELECT
column_name, data_type, column_default, is_nullable
FROM information_schema.tables AS a
INNER JOIN information_schema.columns AS b
ON a.table_catalog = b.table_catalog
AND a.table_schema = b.table_schema
AND a.table_name = b.table_name
WHERE a.table_name = 'Products';

0 تعليقات

إرسال تعليق

Post a Comment (0)

أحدث أقدم
NERV Open Source

Building production Spring Boot systems?

Explore NERV — open-source Java libraries for audit trails, persistence, exception handling, and reliable event-driven architecture.

Explore NERV on GitHub →