This is an area where I have decided to jot down a bunch of useful tidbits for you fellow geeks or wannabe geeks out there. I do not claim for any of my tidbits to be the optimal solutions (there is always a better solution), but I will provide some thoughts and ideas that you can choose to use or abuse in any way you see fit!

fredag 28 augusti 2009

Simple Stored Procedure

Hello,

Here comes a little dash of SQL at ya;

---
Brief explanation: This procedure returns all fields from the table "Users" based on
the parameter @userid, which is an integer type parameter
Input: @userid integer
Output: Resultset with user data
---

CREATE PROCEDURE dbo.sp_getUsers

@userid int

AS

BEGIN

SELECT * FROM Users WHERE id = @userid

END

---

Welcome to Coders corner!

This is an area where I have decided to jot down a bunch of useful tidbits for you fellow geeks or wannabe geeks out there. I do not claim for any of my tidbits to be the optimal solutions (there is always a better solution), but I will provide some thoughts and ideas that you can choose to use or abuse in any way you see fit!

Enjoy!