They are different. When you enclose something in single quotes, it becomes a string -- this is true of all keywords in SQL, including NULL.
When you use just NULL, it is the SQL keyword, and it is compatible with all types.
So, these are quite different:
Copyinsert into t (col1, col2)
values ('2021-05-25 11:58:41.000', NULL);
and:
Copyinsert into t (col1, col2)
values ('2021-05-25 11:58:41.000', 'NULL');
'NULL' is a string and only compatible with a string type. You should get a type-conversion error if the column is not a string.
The one caveat is if you are storing the values in a text file for loading into the database. In such a file, strings may or may not be delimited with single quotes, depending on the structure of the file.
Answer from Gordon Linoff on Stack Overflowsql server 2012 - How can i insert data into a NULL record in a column that allows NOT NULLS? - Database Administrators Stack Exchange
Inserting Null Values into SQL Server
Insert NULL instead of blank if form fields left empty
Insert data into the column which is having null values.
Videos
I am trying to insert my form data into mysql table there are two required fields and others can be left empty but the problem is the empty fields are inserting blank in sql table instead of NULL value. How do i do this? Here is pastebin code link