sql stored procedure
Posted on 2006-04-12
I need to create a stored procedure named spDateRange that accepts two parameters, @DateMin and @DateMax, with data type varchar and default value null. If called with no parameters or with null values, the procedure should return an error message describing the syntax. If called with non-null values, validate the parameters. Test that the literal strings are valid dates and test that @DateMin is earlier than @DateMax. If the parameters are valid, return a result set that includes the InvoiceNumber, InvoiceDate, InvoiceTotal, and Balance for each invoice for which the InvoiceDate is within the date range, sorted with earliest invoice first.
I ma having problem with the message to show the error while checking the syntaxt , I can not get prcedure to read the insturction another words multi statement table to return instructions.