ObserveDBA
ObserveDBA

Reputation: 115

Declare a date to call in a stored procedure

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

[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

Upvotes: 1

Views: 832

Answers (2)

Rahul Tripathi
Rahul Tripathi

Reputation: 172618

You can try like this:

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

Upvotes: 0

Radu Gheorghiu
Radu Gheorghiu

Reputation: 20509

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'

Upvotes: 1

Related Questions