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:

insert into t (col1, col2)
    values ('2021-05-25 11:58:41.000', NULL);

and:

insert 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 Overflow
๐ŸŒ
w3resource
w3resource.com โ€บ sql โ€บ insert-statement โ€บ insert-null.php
Sql inserting NULL values - w3resource
April 30, 2024 - -- INSERT INTO statement begins INSERT INTO agents -- Specifies the table 'agents' where the data will be inserted VALUES ("A001","Jodi","London",.12,NULL); -- Specifies the values to be inserted into each column of the table: -- "A001" will be inserted into the 'agent_code' column (assuming it's a string data type) -- "Jodi" will be inserted into the 'agent_name' column -- "London" will be inserted into the 'working_area' column -- .12 will be inserted into the 'commission' column (assuming it's a numeric data type) -- NULL will be inserted into the 'salary' column, assuming it allows NULL values ... This SQL code attempts to perform an INSERT operation into the 'agents' table.
Discussions

Inserting Null Values into SQL Server
Hi all, Iโ€™m trying to insert and update rows in a SQL Server database with NULL values. The issue that Iโ€™m having is that I continuously receive an error message with no additional information. I have ensured that the table allows for NULL values in those columns and I have tried using ... More on community.n8n.io
๐ŸŒ community.n8n.io
1
0
October 9, 2023
sql server 2012 - How can i insert data into a NULL record in a column that allows NOT NULLS? - Database Administrators Stack Exchange
I hope my questions makes sense but what i am trying to do (which in my mind is obscenely simple which makes it more frustrating that i cant figure it out) is to change a column that consists of NU... More on dba.stackexchange.com
๐ŸŒ dba.stackexchange.com
November 7, 2016
how do you insert null values into sql server - Stack Overflow
In sql server enterprise manager, how do you write an insert statement and pass in null values? More on stackoverflow.com
๐ŸŒ stackoverflow.com
Problem inserting NULL values into SQL
The first bit of code you tried for CaseWeight_val and PalletQTY_val would have worked except there's a mistake in how you're creating the INSERT string. You're putting single quotes around all of the values you are inserting, but numeric values should not have single quotes around them. If you did: query2 = " Values ('" & Article_val & "','" & Product_val & "','" & Content_val & "'," & CaseWeight_val & "," & PalletQTY_val & ",'" & UoM_val & "','" & Shrtnr_val & "','" & Product2_val & "','" & Product3_val & "','" & Batch_val instead it would have worked. You have a related problem with inserting null values for strings. If Article_val is NULL, for example, you are inserting 'NULL' instead of NULL into the database; in other words you are not inserting a null value, you are inserting a string containing the word null. I suggest you rethink the way you are constructing your insert string. My recommendation would be to do something more like this: Dim Article_val as String Dim CaseWeight_val as String Article_val = Iif(IsEmpty(Cells(i, 2).Value),"NULL", "'" & Cells(i, 2).Value & "',") CaseWeight_val = Iif(IsEmpty(Cells(i, 5).Value),"NULL", CStr(Cells(i, 2).Value) & ",") query2 = Article_val & CaseWeight_Val You get the idea. More on reddit.com
๐ŸŒ r/vba
14
7
June 26, 2020
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ sql โ€บ how-to-insert-rows-with-null-values-in-sql
How to Insert Rows with NULL Values in SQL? - GeeksforGeeks
July 23, 2025 - In SQL, due to lack of data, we sometimes need to insert rows with NULL values in the tables. Here, the keyword NULL(without quotes) is used to represent no data.
๐ŸŒ
Scaler
scaler.com โ€บ topics โ€บ sql โ€บ null-value-in-sql
NULL Value in SQL - Scaler Topics
March 28, 2024 - NULL can be inserted in any column by using the assignment operator "=". Also, to test whether a NULL is present or not we have to use certain operators, for example, IS NULL and IS NOT NULL.
๐ŸŒ
Quora
quora.com โ€บ How-do-you-add-null-values-in-SQL
How to add null values in SQL - Quora
Answer (1 of 3): NULL values are handled differently depending on whether they are in the context of a tuple or a set. In the case of a tuple: (e.g. 1 + NULL), the result is always NULL. This is because if any part of a tuple is missing or unknown then the entire tuple cannot be known and hence m...
๐ŸŒ
YouTube
youtube.com โ€บ watch
SQL SERVER||How many ways to insert NULL values into table? - YouTube
1. INSERT INTO emp Values(2,'Lavanya',50000,NULL)2. INSERT INTO emp (id,name,location) VALUES(3,'Ramesh','Chennai')3. ALTER TABLE emp ADD Constraint df_name ...
Published ย  May 7, 2024
Find elsewhere
๐ŸŒ
IBM
ibm.com โ€บ docs โ€บ en โ€บ db2-for-zos โ€บ 12
Inserting null values into columns by using indicator ...
If you need to insert null values into a column, using an indicator variable or array is an easy way to do so. An indicator variable or array is associated with a particular host variable or host-variable array.
๐ŸŒ
Microsoft Learn
learn.microsoft.com โ€บ en-us โ€บ sql โ€บ t-sql โ€บ language-elements โ€บ null-and-unknown-transact-sql
NULL and UNKNOWN (Transact-SQL) - SQL Server | Microsoft Learn
November 22, 2024 - To test for null values in a query, use IS NULL or IS NOT NULL in the WHERE clause. You can insert null values into a column by explicitly stating NULL in an INSERT or UPDATE statement, or by leaving a column out of an INSERT statement.
๐ŸŒ
Quora
quora.com โ€บ What-is-the-command-to-insert-null-values-in-SQL-fields
What is the command to insert null values in SQL fields? - Quora
Answer (1 of 11): SQL INSERT statement is used to insert new records into table. NULL keyword represents undefined value of a column belonging to database table. According to description as mentioned into above question SQL insert statement should not be executed to insert null values into tabl...
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ insert-null-value-into-int-column-in-mysql
Insert NULL value into INT column in MySQL?
June 25, 2020 - You can insert NULL value into an int column with a condition i.e. the column must not have NOT NULL constraints. The syntax is as follows. INSERT INTO yourTableName(yourColumnName) values(NULL); To under
๐ŸŒ
Embarcadero
docwiki.embarcadero.com โ€บ InterBase โ€บ 2020 โ€บ en โ€บ Inserting_Rows_with_NULL_Column_Values
Inserting Rows with NULL Column Values - InterBase
In InterBase a column is set to NULL by specifying NULL for the column in the INSERT statement. For example, the following statement stores a row into the DEPARTMENT table, assigns the values of host variables to some columns, and assigns a NULL value to other columns: EXEC SQL INSERT INTO DEPARTMENT (DEPT_NO, DEPARTMENT, HEAD_DEPT, MNGR_NO, BUDGET, LOCATION, PHONE_NO) VALUES (:dept_no, :dept_name, NULL, NULL, 1500000, NULL, NULL);
๐ŸŒ
W3Schools
w3schools.com โ€บ sql โ€บ sql_null_values.asp
SQL NULL Values - IS NULL and IS NOT NULL
SQL Examples SQL Editor SQL Quiz SQL Exercises SQL Server SQL Syllabus SQL Study Plan SQL Bootcamp SQL Certificate SQL Training ... A field with a NULL value is a field with no value. If a field in a table is optional, it is possible to insert a new record or update a record without adding a value to this field.
๐ŸŒ
ITPro Today
itprotoday.com โ€บ home โ€บ operating systems โ€บ sql server
SQL Server Recent News | ITPro Today
Guide to Decoding SQL Server Bulk Insert Error FilesGuide to Decoding SQL Server Bulk Insert Error Files ยท Learn how to work with SQL Server's ERRORFILE option to isolate problem records, decode cryptic error messages, and avoid duplicate imports when dealing with bulk data loading errors. ... Introduction to SQL Commands, Part 3: Retrieving and Sorting DataIntroduction to SQL Commands, Part 3: Retrieving and Sorting Data
๐ŸŒ
TechOnTheNet
techonthenet.com โ€บ sql โ€บ insert.php
SQL: INSERT Statement
If you want to follow along with this tutorial, get the DDL to create the tables and the DML to populate the data. Then try the examples in your own database! ... The simplest way use the INSERT statement is to insert one record into a table using the VALUES keyword. Let's look at an example ...