Udate Query (1 Viewer)

davidg47

Registered User.
Local time
Yesterday, 21:16
Joined
Jan 6, 2003
Messages
59
Man oh man... I must be dumb as a door nail.

I am trying to update some records in a table named masterIHOP.

So, I go to the Enterprise Manager, open it, navigate to the database named BdbCSSQL and even expand the tables and highlight the masterIHOP table. Then I open the Query Analyzer and type in the following:

Update masterIHOP
Set [reason desc]='No Other Information'
Where
Code:
='V301'

And even though I have tried several ways to type it and with different CAPS configurations, every time I get:
(0 row(s) affected)

What am I doing wrong?

Thanks
 

Matty

...the Myth Buster
Local time
Yesterday, 20:16
Joined
Jun 29, 2001
Messages
396
You're sure there is at least one record with a code of V301?
 

davidg47

Registered User.
Local time
Yesterday, 21:16
Joined
Jan 6, 2003
Messages
59
Yes, positive... actually at first I was using a code that wasn't in the table. So I looked through the table to find an existing code.
 

FoFa

Registered User.
Local time
Yesterday, 20:16
Joined
Jan 29, 2003
Messages
3,672
What happens when you just use a select?
SELECT [reason desc],
Code:
FROM masterIHOP
WHERE [code]='V301'
 

davidg47

Registered User.
Local time
Yesterday, 21:16
Joined
Jan 6, 2003
Messages
59
I got it to work with the first query. I looked and looked for reasons as to why it would not work and everywhere I went, they pretty much said to do it the way I was doing it. So I went to the physical SQL Server and opened the Query Analyzer and typed it in with the same results. So I opened the table to look at the data and saw that there actually was a space between the V and the 301 that would not show up on the old monitor I was using in my office. Well duh! Thanks for your help.
 

Users who are viewing this thread

Top Bottom