need an example of stored procedure

L

luna

any good tutorials anywhere for SELECTing data for use in a webpage using
a stored procedure ?
 
G

Guest

Do a search on a Dataset, will find some examples. Might not be with a store procedure, but you can change the sql statement to sp call.
 
R

Rimu Atkinson

luna said:
any good tutorials anywhere for SELECTing data for use in a webpage using
a stored procedure ?
a simple example. it's parameter is optional, and defaults to 0

CREATE PROCEDURE GetCentersByRegion (

@region_id int = 0

)

AS

if @region_id = 0

BEGIN

SELECT * FROM LawCenters

END

else

BEGIN

SELECT * FROM LawCenters WHERE region_id = @region_id

END
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top