SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2005
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Stored Procedure

    I don't understand why I am getting this message when I run my stored procedure.

    Syntax error converting the varchar value 'IdentityCol' to a column of data type int.

    This is my stored procedure:
    Code:
    ALTER PROCEDURE Login
    (
    @UserName Varchar( 20 ),
    @Password Varchar( 20 )	
    )
    
    AS
    DECLARE @UserID INT
    Set @UserID = 'IdentityCol'
    	SELECT Count (*) FROM dbo.User_Information WHERE User_Name=@UserName AND Password =@Password 		
    	Return @UserID
    I don't see why it thinks the IdentityCol is varchar it is set up as a Int in the table?

    I am just trying to validate a user based on the UserName and password and if it is valid then return the IdentityCol.
    I am stuck so any help is greatly appreciated

  2. #2
    SitePoint Guru
    Join Date
    Jan 2004
    Location
    Uppsala, sverige
    Posts
    700
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    Code:
    ALTER PROCEDURE Login
    (
    @UserName Varchar( 20 ),
    @Password Varchar( 20 )	
    )
    
    AS
    SELECT identityCol 
    FROM dbo.User_Information 
    WHERE User_Name=@UserName 
    AND Password =@Password


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •