SQL Cheat Sheet

These queries are tested in T-SQL on a physical SQL Server.

Cheat Sheet

Get table schema

SELECT  table_name,
        column_name,
        data_type,
        column_default
FROM    information_schema.columns
WHERE   table_name = 'mytablename';