Link to home
Start Free TrialLog in
Avatar of VBdotnet2005
VBdotnet2005Flag for United States of America

asked on

SQL - select

I want to be able to select user by id number or I want to be able to select all users in a single store procedure.
How can I do this?

create procedure sp_username

@id int
as
select id, username from mytable
where id = @id



create procedure sp_username

@id int = null ???
as
select id, username from mytable
where id = @id
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of VBdotnet2005

ASKER

Thank you Jim