Re: Dates, command parameters and SQL Server




"Mark" <mark@xxxxxxxxxx> wrote in message
news:ItAme.1377$%h4.26@xxxxxxxxxxxxxxxxxxxxxxx
> Hi
>
> I am having trouble firing a stored procedure that has a date parameter
> using ADO command etc. Sometimes the date may not be completed so I want
> to pass null back but it won't let me. Although the column type is
> dateTime the parameter is nVarchar (SP was generated by a wizard as a
> test), but even if I pass a zero length string it still inserts a date.
>
> Do I need to place an IF statement in the SP or is there something I Can
> pass from the command parameter that will get recognised as null?


To pass null in a varchar/nvarchar parameter, you must set the Size property
of the parameter to 30.

-Mark



> Thanks inn advance
>
> Mark
>


.



Relevant Pages

  • Re: Return value in stored procedure
    ... In Delphi (you can use TADOStoredProc, TADOQuery, but I would use ... (selecting the stored procedure of choice) ... select the Parameters property and verify Delphi 'filled in' ... begin {Start of with ADO command do} ...
    (borland.public.delphi.database.ado)
  • RE: [MSSQL2000] Stored procedures behaving weird?
    ... as recordset and not output param. ... > Now, since the stored procedure returns data trough OUTPUT parametar, I ... > doesn't return ANY data using OUTPUT parametars), I need to use ADO Command? ...
    (microsoft.public.sqlserver.programming)
  • RE: [MSSQL2000] Stored procedures behaving weird?
    ... as recordset and not output param. ... > Now, since the stored procedure returns data trough OUTPUT parametar, I ... > doesn't return ANY data using OUTPUT parametars), I need to use ADO Command? ...
    (microsoft.public.vb.database)
  • HELP !! Running SQL 2000 using ADO command object from Access 2000
    ... I'm running a SQL 2000 stored procedure from Access client using ... SQLOLEDB provider and ADO Command object. ...
    (microsoft.public.access.adp.sqlserver)
  • Dates, command parameters and SQL Server
    ... I am having trouble firing a stored procedure that has a date parameter ... using ADO command etc. ... Mark ...
    (microsoft.public.data.ado)