Sql-server – Calling Stored Procedure on classic ASP page

asp-classicsql serverstored-procedures

I've been struggling all day calling a Stored Procedure from a classic ASP page. I have a few basic noobie questions.

First, is this the best way to add a parameter to my command:

cmd.Parameters.Append cmd.CreateParameter("@SubmissionDate", adDBTimeStamp, adParamInput, , txtDate)

Second, is adDbTimeStamp the proper type to use when mapping to a smalldatetime parameter in my Stored Procedure?

Third, how do I pass a null date to a datetime stored procedure?

Also, what editors are popular for classic ASP development. I was told to use Dreamweaver (bought CS4) but I'm really having some performance issues and have downgraded to the mighty NotePad.

Thanks!

Best Answer

3

To pass a null parameter to a storred procedure, you simply do not pass it and provide a default.

CREATE PROCEDURE Demo
    @Test datetime = NULL
AS
BEGIN
    -- BLAH
END