So I have a SQL statement that runs fine in Managment Studio, but crashes in my app with "Invalid column name" for every column in the query. This is a programatically generated query.
I'm analyzing it in Management Studio 2005, but the database is on a SQL 2000 server.
Obviously I can't go into much detail due to NDAs and such, but here is an abbreviated version of the SQL query (Syntax intact, only modified field names and such):
select top 5
[field label] = [fld_lbl],
[field label2] = [fld_lbl2],
[field label3] = [fld_lbl3]
--table
from *TABLE*
--conditions
where convert(varchar,[fld_lbl])
Not LIKE
'%90210%'
AND convert(varchar,[fld_lbl2])
= 0
--Sorts
order by
convert(varchar,[fld_lbl])
asc,
convert(varchar,[fld_lbl3])
asc
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.