Replacing a value with NULL in a table in SQL Server using vb.net

Random User

My table will contain the following values. h1,h2,h3 are varchar fields with size 1

    **Register  Date        Year    Batch   h1      h2      h3**    
    1138M0321   02-08-2013  3       1       A       A       NULL
    1138M0323   02-08-2013  3       1       P       P       NULL
    1138M0324   02-08-2013  3       1       P       P       NULL    
    1138M0325   02-08-2013  3       1       P       P       NULL

I need to update one of these fields*(h1/h2/h3)* with NULL. But I can only add "" and not actually NULL How can I update the table with NULL?

SysDragon

The NULL value must be SQL, not a .NET value, so instead of trying things like:

"... SET h1 = " & NULL & " ... "

Simply use this in the query:

"... SET h1 = NULL ... "

Note that:

Null values cannot be used for information that is required to distinguish one row in a table from another row in a table, such as primary keys.

See MSDN Documentation.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Deleting and replacing entries in a table using SQL Server

From Dev

Get the value of print statement of sql server in vb.net by using oledb

From Dev

Getting null value from Attendance Log table and Employee table using SQL Server query?

From Dev

Getting null value from Attendance Log table and Employee table using SQL Server query?

From Dev

Get number of rows in a SQL Server table in VB.NET

From Dev

SQL Server Table is accessible in SSMS but returns error in VB.NET

From Dev

Connecting to a SQL Server database using VB.NET

From Dev

how to search records in sql server using vb.net

From Dev

How to check if record exist using vb.net and SQL Server

From Dev

Connect to SQL Server via USB using VB.NET

From Dev

Crystal Reports using vb.net 2008 and SQL Server database

From Java

Replacing NULL with 0 in a SQL server query

From Dev

SQL Server replacing null with empty string

From Dev

SQL Server replacing null with empty string

From Dev

SQL Replacing a Null value with 0 within a Pivot

From Dev

Replacing / with - in SQL Server using Select Command

From Dev

Replacing a range within a fixed length file using VB.NET

From Dev

Null value in access with combobox (vb.net)

From Dev

Pitfalls of SQL database table BULK update, using staging table and bulkcopy in vb.net

From Dev

Replacing null values for multiple columns in a table with a constant value

From Dev

LINQ to SQL Pivot table in VB.net

From Dev

Getting null value on declaring String as a Control in Windows Form using Vb.Net

From Dev

connect to LAN sql server vb.net

From Dev

How can I more efficiently deal with DBNull.value in vb.net / SQL Server

From Dev

Email a table using VB.Net

From Dev

Email a table using VB.Net

From Dev

Replacing NAs in column with values from another table SQL Server

From Dev

How to count number of rows in a sql table with vb.net using sqlclient class

From Dev

How to retrieve VARBINARY values from SQL Server 2008 using VB.Net

Related Related

  1. 1

    Deleting and replacing entries in a table using SQL Server

  2. 2

    Get the value of print statement of sql server in vb.net by using oledb

  3. 3

    Getting null value from Attendance Log table and Employee table using SQL Server query?

  4. 4

    Getting null value from Attendance Log table and Employee table using SQL Server query?

  5. 5

    Get number of rows in a SQL Server table in VB.NET

  6. 6

    SQL Server Table is accessible in SSMS but returns error in VB.NET

  7. 7

    Connecting to a SQL Server database using VB.NET

  8. 8

    how to search records in sql server using vb.net

  9. 9

    How to check if record exist using vb.net and SQL Server

  10. 10

    Connect to SQL Server via USB using VB.NET

  11. 11

    Crystal Reports using vb.net 2008 and SQL Server database

  12. 12

    Replacing NULL with 0 in a SQL server query

  13. 13

    SQL Server replacing null with empty string

  14. 14

    SQL Server replacing null with empty string

  15. 15

    SQL Replacing a Null value with 0 within a Pivot

  16. 16

    Replacing / with - in SQL Server using Select Command

  17. 17

    Replacing a range within a fixed length file using VB.NET

  18. 18

    Null value in access with combobox (vb.net)

  19. 19

    Pitfalls of SQL database table BULK update, using staging table and bulkcopy in vb.net

  20. 20

    Replacing null values for multiple columns in a table with a constant value

  21. 21

    LINQ to SQL Pivot table in VB.net

  22. 22

    Getting null value on declaring String as a Control in Windows Form using Vb.Net

  23. 23

    connect to LAN sql server vb.net

  24. 24

    How can I more efficiently deal with DBNull.value in vb.net / SQL Server

  25. 25

    Email a table using VB.Net

  26. 26

    Email a table using VB.Net

  27. 27

    Replacing NAs in column with values from another table SQL Server

  28. 28

    How to count number of rows in a sql table with vb.net using sqlclient class

  29. 29

    How to retrieve VARBINARY values from SQL Server 2008 using VB.Net

HotTag

Archive