| Author |
Topic |
|
Tinister
Starting Member
4 Posts |
Posted - 2008-05-12 : 11:31:51
|
Before you ask, yes I know this is a common-ish error message and I have been searching around for a bit for solutions. The problem is, however, is that the query I'm trying to run is so incredibly simple that those solutions don't really apply...Here's the SQL:select top 1000[test].[CatalogStudioId], [test].[CollectionId], [test].[unique], [test].[att1]from CatalogStudioEntity.dbo.[test] where [test].[att1] like '%1%' And apparently none of those columns can be bound.Queries of this general syntax have worked on SQL Server 2005 installations I've been working on until now, so what could possibly be screwy with this specific installation where that query doesn't work?And yes, I know using the table name to qualify the columns is redundant and I know there are other options (such as using aliases), but I'd rather try to troubleshoot this before reworking the code that generates these sql queries.Thanks! |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-05-12 : 11:36:59
|
[code]SELECT TOP 1000 [CatalogStudioId], [CollectionId], [unique], [att1]FROM CatalogStudioEntity.dbo.[test]where [att1] like '%1%'[/code] E 12°55'05.25"N 56°04'39.16" |
 |
|
|
Tinister
Starting Member
4 Posts |
Posted - 2008-05-12 : 11:45:37
|
Allow me to reiterate:quote: And yes, I know using the table name to qualify the columns is redundant and I know there are other options (such as using aliases), but I'd rather try to troubleshoot this before reworking the code that generates these sql queries.
|
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-05-12 : 11:51:14
|
You could at least try the query as suggested to rule out other errors such as permissions.Or at least to verify that the table really exists.What do YOU want to do? E 12°55'05.25"N 56°04'39.16" |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-05-12 : 12:00:40
|
| Are you sure eror is in this code? Could you post query if possible? |
 |
|
|
Tinister
Starting Member
4 Posts |
Posted - 2008-05-12 : 12:01:44
|
| The query as suggested does work and the tables do exist, thanks.Our application allows users to create their own database tables as part of a dynamic data model. I have code that generates SQL like the one from my first post. The code qualifies the columns with the table name because it's possible for them to do a select across multiple tables, and this solves the issue if they have columns on two different tables with the same name.What I was hoping for -- and I apologize if I wasn't being clear -- was to get any ideas on why this isn't working. Like I said, of all the machines running SQL Server 2005 that we've deployed this application on, this is the first machine to have issues with this type of SQL. I'd rather fix some setting on this particular SQL Server installation, if that is indeed possible, before I go and "fix" something in our application that I do not believe to be a bug with us. |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-05-12 : 13:42:59
|
I believe you.You are the authority on your system. You have used it for a long time, and we have never heard of it until today.Since you are reluctant to answer some simple "baseline" questions, I gracefully drop out of this topic. E 12°55'05.25"N 56°04'39.16" |
 |
|
|
Tinister
Starting Member
4 Posts |
Posted - 2008-05-12 : 14:02:06
|
| Where was I reluctant to answer questions? You had a grand total of two replies, in your first reply you just pumped out a SQL statement with no other discussion, and I responded to your second reply quite extensively.Anyway, we did some troubleshooting and it appears SQL Server throws this error if we are connected to the "master" database, despite the fact that we are qualifying the table with the database name. If we connect specifically to the "CatalogStudioEntity" database it does work. Does anyone else have any ideas why that might be an issue? |
 |
|
|
|