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)
 passing the parameter in SP

Author  Topic 

jung1975
Aged Yak Warrior

503 Posts

Posted - 2006-01-10 : 12:38:26
I would like to set the default parameter in SP, So I can pass either one of the parameters( not both).But, I keep getting an syntax error...

create procedure test( @DateProcessed is null datetime , @checkaccountnumber is null int )
AS
SELECT ID, [ClientNumber], CDNumber,[TransactionId],SequenceID, [DocumentType], convert(varchar(10),[DateProcessed],121) as DateProcessed,
convert(varchar(10), Dateprocessed,121) as MailOpenDate, LockboxId,
convert(varchar(10),Depositedate, 121) as Depositedate, CheckAccountNumber,CheckReturnNumber,convert(decimal(10,2), CheckAmount) as CheckAmt
FROM [IDXCDData]
where( appliedcash = 0 and DocumentType = 'CHECK'
and dateprocessed = @DateProcessed) or
(DocumentType = 'CHECK'
and checkaccountnumber = @checkaccountnumber)
order by ID asc




nr
SQLTeam MVY

12543 Posts

Posted - 2006-01-10 : 12:57:52
create procedure test
@DateProcessed datetime = null ,
@checkaccountnumber int = null
as


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -