if exists (select * from sysobjects where name = 'usp_BorrowBook') drop proc usp_BorrowBook go create proc usp_BorrowBook @LendDate datetime = '2014-04-01', @WillDate datetime = null as set @WillDate=isnull(@WillDate,getdate()) select COUNT(RID) from Borrow where LendDate between @LendDate and @WillDate
drop proc usp_BorrowBook
go
create proc usp_BorrowBook
@LendDate datetime = '2014-04-01',
@WillDate datetime = null
as
set @WillDate=isnull(@WillDate,getdate())
select COUNT(RID)
from Borrow
where LendDate between @LendDate and @WillDate