|
-
Feb 18th, 2004, 10:30 AM
#1
Thread Starter
Lively Member
Insert <NULL> into SQL
Hi,
Am writing an update statement to one of my SQL tables. I have fields which are <NULL> I want them to remain so after the update. When I update they either become blank or Null.
How can I keep them <NULL>.
Any help would be appreciated.
-
Feb 18th, 2004, 10:33 AM
#2
New Member
Shouldn't be happening
Show us your SQL statement
-
Feb 18th, 2004, 10:53 AM
#3
Thread Starter
Lively Member
If (AccountName = "") Then
SqlComm.CommandText = "UPDATE Accounts SET " + _
" Name = " + DBNull.Value + " WHERE AccountKey = " + AccountKey.ToString()
End IF
The above SQL statement inserts blank into the column.
-
Feb 19th, 2004, 07:56 AM
#4
New Member
Do it in SQL.
Code:
"UPDATE accounts SET name = NULL where accountkey = " + accountkey.tostring()
syntax might be different for different databases but it works fine for me on MS SQL Server
-
Feb 19th, 2004, 06:10 PM
#5
Thread Starter
Lively Member
Thanks a lot...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|