Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Anyone know what might be wrong?

Author  Topic 

Eagle_f90
Constraint Violating Yak Guru

424 Posts

Posted - 2002-04-12 : 16:10:45
When I go to do a where clasue in the select command I always get the same error:
Server: Msg 207, Level 16, State 3, Line 1
Invalid column name 'test'.

This is the code I use. (and I have checked my spelling all is correct)

select *
from stats
where f_playerid = test

JamesT
Yak Posting Veteran

97 Posts

Posted - 2002-04-12 : 16:26:51
What is the data type of test? If it is character in nature, SQL will think that test is a column name. If is is character put quotes around it like such:

select *
from stats
where f_playerid = 'test'

Go to Top of Page

Eagle_f90
Constraint Violating Yak Guru

424 Posts

Posted - 2002-04-12 : 16:28:14
Thanks the " ' ' " did it.

Go to Top of Page
   

- Advertisement -