Go Back   CodingForums.com > :: Server side development > MySQL > Other Databases

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-29-2005, 08:09 PM   PM User | #1
ClueLess
Regular Coder

 
Join Date: Nov 2002
Posts: 184
Thanks: 0
Thanked 0 Times in 0 Posts
ClueLess is an unknown quantity at this point
SQL - Create procedure error??????

When I tried to create this procedure. I received an error - at line "SET @ Num_of_User = (SELECT COUNT(*) AS Num_of_User" It said that " Server: Msg 170, Level 15, State 1, Procedure sp_ValidateUser, Line 8
Line 8: Incorrect syntax near 'Num_of_User'."

Does anyone know why? Thanks for your help.


CREATE PROCEDURE sp_ValidateUser
(
@UserName VARCHAR(50) = NULL,
@Password VARCHAR(50) = NULL,
@Num_of_User INT = 0
)
AS
SET @ Num_of_User = (SELECT COUNT(*) AS Num_of_User
FROM NorthWindUsers
WHERE UserName = @UserName AND Password = @Password)
RETURN @Num_of_User
ClueLess is offline   Reply With Quote
Old 03-30-2005, 01:51 AM   PM User | #2
Noodles24
Regular Coder

 
Join Date: Feb 2005
Location: UK
Posts: 133
Thanks: 0
Thanked 0 Times in 0 Posts
Noodles24 is an unknown quantity at this point
my first guess would be to remove the space between @ and Num_of_User
__________________
Cooking Forum | Health Forums
Noodles24 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:13 AM.


Advertisement
Log in to turn off these ads.