Wednesday, February 15, 2012

Entering null into blank fields in the database

How can I enter NULL manually in one of the rows in Sql Server database. Those rows does not contain any data.
you can use DbNull.Value. If its a datetime datatype you need to use SqlDateTime.Null and import Sqltypes namespace.
|||well the problem is bit different. I have 4 rows with 4 fields each. Like Name, Age, Address, Phone number.
Now Name, Age , Address is filled with some data. But I forgot to adddata for the phone and now its just blank. How can I make this nullinstead of blank.

|||UPDATE
<table>
SET
[phone]= NULL
WHERe
[phone] = ' '

No comments:

Post a Comment