I have the following stored procedure created to find an employee username. I now want to use the parameter @Username in a select statement and save it in a view but it is saying i must declare scalar variable when trying to save the view. If i just run the query in query editor without saving, it runs fine. Any ideas?
CREATE PROCEDURE dbo.LoginCheck
/* Parameters needed to obtain data from user*/
@UserName VARCHAR(50)= Null
SELECT * from dbo.EmployeeLogin
WHERE (dbo.Employeelogin.Uname = @UserName)
No luck i'm afraid Brett. Trying to save the query as a view but it keeps asking me to declare etc.
Anyone got some links to login system tutorials. Have a login form working correctly with usernames/passwords in database but can't get data grid to find records associated with username inputted to work on second form basing on username inputted
I am using SQL Server 2005, Designing Winform Application through VStudio 2008.
I have usernames/passwords in sql table. I have the login part working where the user can login by validating against the username/password stored in the login table but i need to bring back the user's information in a grid view etc. on Form 2 based on their employeeid which is referenced in all other tables.
All Other Tables
My problem is that i somehow need to save the inputted Username/password on Form 1 as variables and somehow pass these to my SQL Statements on Form 2 so the correct records return for that individual only.