SQL Stored Procedure Parameters being Corrupted?

前端 未结 1 1632
迷失自我
迷失自我 2021-01-25 16:22

I have a stored procedure that for now is just suppose to validate your string input as a valid date. I\'ve tried running this outside of a procedure and it works flawlessly, bu

相关标签:
1条回答
  • 2021-01-25 16:46

    You need to give an explicit length for the varchar parameters. It defaults to 1 character.

    char(10) should be enough for valid dates in dd/mm/yyyy format but I guess you might want longer as this is validating potentially invalid dates!

    CREATE PROCEDURE spDateRange
    @DateMin varchar(30) = NULL,
    @DateMax varchar(30) = NULL
    AS
    
    0 讨论(0)
提交回复
热议问题