1

The below query works fine in mssql. I tried using information_schema instead of sys. But no luck in mysql.

            SELECT c.NAME AS property_name,
                   t.NAME AS datatype
            FROM   sys.columns c
            JOIN   sys.objects o
            ON     o.object_id = c.object_id
            JOIN   sys.types t
            ON     t.user_type_id = c.user_type_id
            JOIN   sys.schemas s
            ON     o.schema_id = s.schema_id
            WHERE  s.NAME ='{0}'
            AND    o.NAME ='{1}

1 Answer 1

1

Here you go:

SELECT
    COLUMN_NAME AS property_name,
    DATA_TYPE AS datatype
FROM information_schema.columns
WHERE
    TABLE_SCHEMA = {0} AND
    TABLE_NAME = {1}
ORDER BY ORDINAL_POSITION
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks lot for the help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.