# sql\_mode

**URL:** <https://forums.percona.com/t/sql-mode/923>\
**Category:** Other MySQL® Questions\
**Created:** [September 11, 2008, 1:45pm UTC](https://forums.percona.com/t/sql-mode/923 "2008-09-11T13:45:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![viswapsp](https://avatars.discourse-cdn.com/v4/letter/v/2acd7d/32.png) [@viswapsp](https://forums.percona.com/u/viswapsp)\
**Post date:** [September 11, 2008, 1:45pm UTC](https://forums.percona.com/t/sql-mode/923/1 "2008-09-11T13:45:18Z")

</div>

Hello,  
I am new to mySQL, so have few questions on how things work in this environment.

Though I have placed constraints such as NOT NULL, on a table, it is accepting null values into the columns of a table. How do I restrict?

I would like to know more on sql\_mode and how to set it at the server level, so that it applies to all the databases.

Thank you for looking at this post.

---

<div class="post-metadata">

**Author:** ![xaprb](https://avatars.discourse-cdn.com/v4/letter/x/49beb7/32.png) [@xaprb](https://forums.percona.com/u/xaprb)\
**Post date:** [December 25, 2009, 10:48am UTC](https://forums.percona.com/t/sql-mode/923/2 "2009-12-25T10:48:46Z")

</div>

You should look at the MySQL manual for SQL\_MODE. If you have a column defined NOT NULL, then it won’t store NULL, but it will convert the NULL into the column’s default value.

It is impossible to completely prevent this, but SQL\_MODE can help make it less common.
