Posted on: 7/12/2013 4:00:32 AM | Views : 234

hi guys 
i have 3 table 
1)AdminLogin   Columns are:    Id UserName  Password
2)SuperAdminLogin  columns are:     Id UserName Password
3)UserLogin  Columns are:    Id UserName  Password
i want to select Id From these tables one by one, and if username and password match then redirect to page with Id
so i have written stored procedure for that 
:
   Create PROCEDURE [dbo].[SpLogin]     @Username varchar(50),     @Password varchar(50),     @ID int output AS BEGIN    IF EXISTS(Select @ID=(Select Id FROM SuperAdminLogin_Details WHERE Username =@Username and Password =@Password ))     BEGIN      SET @ID=1     END END

Then Its Give me error:
Incorrect syntax near '='. Msg 102, ...

Go to the complete details ...