Wednesday, November 17, 2010

Passing Parameter To The SP

Passing Parameter

 to pass current datetime as a parameter to an SP. is like this : declare @rrr datetime = getdate() exec

The following will
droprouteprocessing @inpdate = @rrrnot work :
droprouteprocessing GetDate()exec droprouteprocessing @inpdate = getdate()exec droprouteprocessing (select getdate())exec

droprouteprocessing select getdate() particular, the last two statements will work as though they are sql statements. Hence the SP will execute with default parametersand
then select GETDATE() statement will be executed, which will display current datetime on console.

Suppose I want

The only way it will work
To The SP

No comments:

Post a Comment