开发者

Finding all tables having not null constraints in mysql

How to find all the table and column names that have not null con开发者_如何学Pythonstraint


If you have an access to information_schema database, you can use this query:

SELECT `TABLE_NAME`, `COLUMN_NAME`
FROM `information_schema`.`COLUMNS`
WHERE
`IS_NULLABLE` = 'No'
AND `TABLE_SCHEMA` = 'Your database name goes here'

Tested in MySQL 5.1

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜