Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 insert Null into SQL field from VB 6

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-01-28 : 08:17:43
Sharon writes "I am unable to get an execute stored procedure call from VB6 to take a parameter containing Null to a datetime field in a table in MS SQL2000.

I need an existing record in SQL, with a datetime field, which currently contains a valid date, reset to Null. I've tried every parameter data type I can find an example of, as well as using CONVERT in the stored procedure.

Any help would be GREATLY appreciated!!

Sharon

ps Make fun all you want, if you can help me.>)"

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-01-28 : 09:36:24
in the stored procedure put the default value for the datetime parameter to null,
then when you want to insert the null dont't specify the value of the parameter in your app.
in the sproc:

alter proc mySProc
@datetimeParam datetime null,
...
as
update t1
set datetimeCol = @datetimeParam
...

Go with the flow & have fun! Else fight the flow
Go to Top of Page
   

- Advertisement -