Sql server 2005 stored procedure parameter default value

If you want to use the Created as a default though, then set null as the default parameter value and set the Created parameter with getdate if it comes with null in your sp.

sql server 2005 stored procedure parameter default value

You can't use a function as a parameter value. What I do is I set the parameter to some out of scope date like '' and then I check for it in the proc.

By posting your answer, you agree to the privacy policy and terms of service. Stack Overflow Questions Developer Jobs Documentation beta Tags Users.

SQL Server Forums - setting a STORED PROCEDURE a default time value

Sign up or log in to customize your list. Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow sql server 2005 stored procedure parameter default value company Business Learn more about hiring developers or posting ads with us. Log In Sign Up. Join the Stack Overflow Community.

Stored Procedure Parameters - Setting a default value

Stack Overflow is a community of 7. Join them; it only takes a minute: I want to know why I can't set default value to SP datetime parameter to getdate as below: I know that i can do it like below Create PROCEDURE [dbo].

sql server - stored procedure with a default value - Stack Overflow

Amr Badawy 3, 11 38 You can't use a function call as a mobile bridal hair and makeup lancashire parameter value. It's easy to work around: Mitch Wheat k 28 Is there any explanation why it can't accept this.

SpaceCracker the reason I believe is that what you'd be doing if it were to allow you is to run the getdate function at the time your code was compiled keep in mind we're compiling code and store the result of that one run of getdate as the default value Sign up or log in StackExchange.

Sign up using Facebook.

SQL Server - Specifying Optional Parameter in Stored Procedure

Sign up using Email and Password. Post as a guest Name.

sql server 2005 stored procedure parameter default value

Stack Overflow works best with JavaScript enabled. MathOverflow Mathematics Cross Validated stats Theoretical Computer Science Physics Chemistry Biology Computer Science Philosophy more 3. Meta Stack Exchange Stack Apps Area 51 Stack Overflow Talent.

sql server 2005 stored procedure parameter default value
Rating 4,3 stars - 887 reviews
inserted by FC2 system