December 31, 2003 at 6:51 am
declare
@varUser_Name as nvarchar(30),
@varPassword as nvarchar(50)
set @varUser_Name = 'Brain Pregler'
set @varPassword = 'beer'
select operator_ID from operator
where username = @varUser_Name and password = @varPassword
I am trying to test this query for a vb.net app. if I hard code the username and password the qwery works. what am I missing
December 31, 2003 at 6:58 am
I am using query analizer to test this code
December 31, 2003 at 6:58 am
I am using query analizer to test this code
December 31, 2003 at 7:00 am
What error are you getting?
In your example, is the @varUser_Name a typo?
You have BRAIN, shouldn't it be BRIAN?
-SQLBill
December 31, 2003 at 7:02 am
oh dear god. it is time to go to sleep. sorry about wasting your time. thanks SQLBill
December 31, 2003 at 7:10 am
You have to add an N to the front of the variable.
set @varUser_Name = N'Brain Pregler'
set @varPassword = N'beer'
This is from books online:
"Unicode constants are specified with a leading N: N'A Unicode string'"
Tom
December 31, 2003 at 7:10 am
It wasn't a waste of time....sometimes the little things are just overlooked. I know I've had it happen to me.
-SQLBill
When is the obvious not obvious? When someone else has to point it out to me!
Viewing 7 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply