I have a column in my table having data type as TEXT
.
How can I give it a default NULL
value, so that when there is not entry in the column it doesn't consume memory.
I was reading a similar question on a forum where they said column should be allowed for null values; I did that but it doesn't work..
For numeric types, the default is 0 , with the exception that for integer or floating-point types declared with the AUTO_INCREMENT attribute, the default is the next value in the sequence. For date and time types other than TIMESTAMP , the default is the appropriate “zero” value for the type.
Default values can be NULL, or they can be a value that matches the data type of the column (number, text, date, for example).
In Object Explorer, right-click the table with columns for which you want to change the scale and select Design. Select the column for which you want to specify a default value. In the Column Properties tab, enter the new default value in the Default Value or Binding property.
SQL Server Default Value A column can be given a default value using the DEFAULT keyword. The DEFAULT keyword provides a default value to a column when the SQL Server INSERT INTO statement does not provide a specific value. The default value can be a literal value, an expression, or a SQL Function, such as GETDATE().
TEXT
does not support default values of anything but NULL
. As such, it's implicitly DEFAULT NULL
, so you should not need to change anything.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With