|
-
Jun 13th, 2000, 05:18 PM
#1
Thread Starter
Addicted Member
Does anyone know how to write a SQL Server stored procedure that will check if an item is in a database? Here is what I have at the moment, but it doesn't seem to be working:
CREATE Procedure sp_mdLoginUser
@Username varChar(50),
@PassToken varChar(50)
As
DECLARE @UserID int
SELECT
Username,
PassToken
FROM
Users
WHERE
Username = @Username
If @@error = 0
BEGIN
SELECT @UserID = @@IDENTITY
return @UserID
END
ELSE
BEGIN
return(0)
END
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|