Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How To Do This Query
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
How To Do This Query
Miscellaneous
Thread ID:
01172321
Message ID:
01172321
Views:
52
I want to create a proc that pulls either a single record based in the RecId or all
records if no Id was passed in.

What am I doing wrong here?
CREATE PROCEDURE syGetUser
	@RecId integer = NULL

AS

	SELECT RecId,
	       GroupId, 
	       FullName
	       UserName, 
	       Password
	  FROM appUsers
	  WHERE (RecId = @RecId) OR ISNULL(@RecId)
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Next
Reply
Map
View

Click here to load this message in the networking platform