声明要在存储过程中调用的日期

时间:2022-12-14 09:38:13

In a Stored Procedure, I intend to Execute the SP but have to give it the parameter date. The Stored Procedure looks like this:

在存储过程中,我打算执行SP但必须给它参数日期。存储过程如下所示:

[dbo].[ADM_CTM]

The parameter is set up like this:

参数设置如下:

@CurDate(smalldatetime, input, Nodefault)

In my effort, I did this:

在我的努力中,我这样做了:

EXEC [dbo].[ADM_CTM] @CurDate(20151001)

Please correct the Execution statement as necessary. Thank you

请根据需要更正执行声明。谢谢

2 个解决方案

#1


1  

EXEC [dbo].[ADM_CTM] @CurDate = '20151001'

Although I recommend explicitly specifying the month, so as to not encounter date format issues:

虽然我建议明确指定月份,以免遇到日期格式问题:

EXEC [dbo].[ADM_CTM] @CurDate = '01-OCT-2015'

#2


0  

You can try like this:

你可以尝试这样:

EXEC [dbo].[ADM_CTM] @CurDate = '20151001'

#1


1  

EXEC [dbo].[ADM_CTM] @CurDate = '20151001'

Although I recommend explicitly specifying the month, so as to not encounter date format issues:

虽然我建议明确指定月份,以免遇到日期格式问题:

EXEC [dbo].[ADM_CTM] @CurDate = '01-OCT-2015'

#2


0  

You can try like this:

你可以尝试这样:

EXEC [dbo].[ADM_CTM] @CurDate = '20151001'