Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 set default value in SP

Author  Topic 

jung1975
Aged Yak Warrior

503 Posts

Posted - 2005-08-15 : 12:24:07
Can I set getdate() as the default value in SP parameter?
I am keep getting the syntax error...

CREATE PROCEDURE dbo.usp_Import_DX_Driver
( @startdate datetime = getdate() - 7,
@enddate datetime = getdate
as

~~~~~




Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2005-08-15 : 13:26:59
create ....
@startdate datetime = null
...
as
begin
set @startdate = coalesce(@startdate,current_timestamp)
...
end

Jay White
Go to Top of Page
   

- Advertisement -