473,796 Members | 2,482 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A question about an error message

Hello!

I am new to this group and I hope anyone can help me. I have an error
message which is very complicated to me. Okay this message is very
simpel, but I don`t understand how to build my SQL statement. I use
MsSQL 2000 and I am new to Microsoft SQL. I have searched the web and
read the online help, but it is strange to me. At first here is my
statement:

SET QUOTED_IDENTIFI ER ON
GO
SET ANSI_NULLS ON
GO

ALTER VIEW dbo.view_result s_7
AS
SELECT TOP 100 PERCENT dbo.view_result s_7a.*, dbo.table.MCC,
dbo.table.MNC, ...dbo.table.HP RP
FROM dbo.view_result s_7a INNER JOIN
dbo.table ON dbo.view_result s_7a.MCC COLLATE SQL_Latin1_CP1_ CI_AS =
dbo.table.MCC
WHERE dbo.view_result s_7a.IMSI <>
IMSI_Blacklist. tblIMSI_Stierin g_Blacklist.IMS I
ORDER BY dbo.view_result s_7a.BegTime DESC

GO
SET_QUOTED IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

The part in the WHERE clause throws this error. It is the error message
number 107 and the message:
"The column prefix '%.*ls' does not match with a table name or alias
name used in the query."
What is wrong with this statement? My only experience in SQL is MySQL
and I have written this statement like a MySQL statement. So is there
anyone who can help me? Please I need your help!

Dec 19 '06 #1
7 2128
I don't think you can have dbo.table.* and probably that's what the
error says when it tried to expand dbo.view_result s_7a.*
....not sure though...

Co******@gmx.de wrote:
Hello!

I am new to this group and I hope anyone can help me. I have an error
message which is very complicated to me. Okay this message is very
simpel, but I don`t understand how to build my SQL statement. I use
MsSQL 2000 and I am new to Microsoft SQL. I have searched the web and
read the online help, but it is strange to me. At first here is my
statement:

SET QUOTED_IDENTIFI ER ON
GO
SET ANSI_NULLS ON
GO

ALTER VIEW dbo.view_result s_7
AS
SELECT TOP 100 PERCENT dbo.view_result s_7a.*, dbo.table.MCC,
dbo.table.MNC, ...dbo.table.HP RP
FROM dbo.view_result s_7a INNER JOIN
dbo.table ON dbo.view_result s_7a.MCC COLLATE SQL_Latin1_CP1_ CI_AS =
dbo.table.MCC
WHERE dbo.view_result s_7a.IMSI <>
IMSI_Blacklist. tblIMSI_Stierin g_Blacklist.IMS I
ORDER BY dbo.view_result s_7a.BegTime DESC

GO
SET_QUOTED IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

The part in the WHERE clause throws this error. It is the error message
number 107 and the message:
"The column prefix '%.*ls' does not match with a table name or alias
name used in the query."
What is wrong with this statement? My only experience in SQL is MySQL
and I have written this statement like a MySQL statement. So is there
anyone who can help me? Please I need your help!
Dec 19 '06 #2
Hi,
I modified your query a little bit:

ALTER VIEW view_results_7
AS
SELECT TOP 100 PERCENT view_results_7a .*, table.MCC,
table.MNC, ...table.HPRP
FROM view_results_7a INNER JOIN
table ON view_results_7a .MCC = table.MCC
WHERE view_results_7a .IMSI <tblIMSI_Stieri ng_Blacklist.IM SI
ORDER BY view_results_7a .BegTime DESC

Co******@gmx.de wrote:
Hello!

I am new to this group and I hope anyone can help me. I have an error
message which is very complicated to me. Okay this message is very
simpel, but I don`t understand how to build my SQL statement. I use
MsSQL 2000 and I am new to Microsoft SQL. I have searched the web and
read the online help, but it is strange to me. At first here is my
statement:

SET QUOTED_IDENTIFI ER ON
GO
SET ANSI_NULLS ON
GO

ALTER VIEW dbo.view_result s_7
AS
SELECT TOP 100 PERCENT dbo.view_result s_7a.*, dbo.table.MCC,
dbo.table.MNC, ...dbo.table.HP RP
FROM dbo.view_result s_7a INNER JOIN
dbo.table ON dbo.view_result s_7a.MCC COLLATE SQL_Latin1_CP1_ CI_AS =
dbo.table.MCC
WHERE dbo.view_result s_7a.IMSI <>
IMSI_Blacklist. tblIMSI_Stierin g_Blacklist.IMS I
ORDER BY dbo.view_result s_7a.BegTime DESC

GO
SET_QUOTED IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO

The part in the WHERE clause throws this error. It is the error message
number 107 and the message:
"The column prefix '%.*ls' does not match with a table name or alias
name used in the query."
What is wrong with this statement? My only experience in SQL is MySQL
and I have written this statement like a MySQL statement. So is there
anyone who can help me? Please I need your help!
Dec 19 '06 #3
Hi

Thanks for your answer, but the problem still exists. There is the same
error message like before.

ot*******@yahoo .com schrieb:
>
ALTER VIEW view_results_7
AS
SELECT TOP 100 PERCENT view_results_7a .*, table.MCC,
table.MNC, ...table.HPRP
FROM view_results_7a INNER JOIN
table ON view_results_7a .MCC = table.MCC
WHERE view_results_7a .IMSI <tblIMSI_Stieri ng_Blacklist.IM SI
ORDER BY view_results_7a .BegTime DESC

I have forgot to tell you that the table tblIMSI_Stierin g_Blacklist is
from another database but on the same server, so I have to write in
this way:

ALTER VIEW view_results_7
AS
SELECT TOP 100 PERCENT view_results_7a .*, table.MCC,
table.MNC, ...table.HPRP
FROM view_results_7a INNER JOIN
table ON view_results_7a .MCC = table.MCC
WHERE view_results_7a .IMSI <>
IMSI_Blacklist. dbo.tblIMSI_Sti ering_Blacklist .IMSI
ORDER BY view_results_7a .BegTime DESC

The error is still the same :-(

Dec 19 '06 #4
(Co******@gmx.d e) writes:
I am new to this group and I hope anyone can help me. I have an error
message which is very complicated to me. Okay this message is very
simpel, but I don`t understand how to build my SQL statement. I use
MsSQL 2000 and I am new to Microsoft SQL. I have searched the web and
read the online help, but it is strange to me. At first here is my
statement:

SET QUOTED_IDENTIFI ER ON
GO
SET ANSI_NULLS ON
GO

ALTER VIEW dbo.view_result s_7
AS
SELECT TOP 100 PERCENT dbo.view_result s_7a.*, dbo.table.MCC,
dbo.table.MNC, ...dbo.table.HP RP
FROM dbo.view_result s_7a INNER JOIN
dbo.table ON dbo.view_result s_7a.MCC COLLATE SQL_Latin1_CP1_ CI_AS =
dbo.table.MCC
WHERE dbo.view_result s_7a.IMSI <>
IMSI_Blacklist. tblIMSI_Stierin g_Blacklist.IMS I
ORDER BY dbo.view_result s_7a.BegTime DESC
...
The part in the WHERE clause throws this error. It is the error message
number 107 and the message:
"The column prefix '%.*ls' does not match with a table name or alias
name used in the query."
What is wrong with this statement? My only experience in SQL is MySQL
and I have written this statement like a MySQL statement. So is there
anyone who can help me? Please I need your help!
Didn't you get a complete error message? That should tell you what is
wrong.

But I can see the error: IMSI_Blacklist. tblIMSI_Stierin g_Blacklist comes
out of nowhere. I don't know what is supposed to be, so I can't suggest
an alternative. But I would not expect the above to work on MySQL either.

Two more things:
1) Remove TOP 100 PERCENT and ORDER BY. They don't mean anything logically,
but they can result in extra processing. In SQL 2000 it may seem that
if you run a SELECT on the view that you always get data in the order
of the ORDER BY clause, but that is mere chance, and it does not happen
that easily in SQL 2005.

2) Try to remove the COLLATE clause. Adding to the query when it is not
needed can prevent indexes from being used and hamper performance.

--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Dec 19 '06 #5
Erland Sommarskog schrieb:
>
Didn't you get a complete error message? That should tell you what is
wrong.

But I can see the error: IMSI_Blacklist. tblIMSI_Stierin g_Blacklist comes
out of nowhere. I don't know what is supposed to be, so I can't suggest
an alternative. But I would not expect the above to work on MySQL either.

Two more things:
1) Remove TOP 100 PERCENT and ORDER BY. They don't mean anything logically,
but they can result in extra processing. In SQL 2000 it may seem that
if you run a SELECT on the view that you always get data in the order
of the ORDER BY clause, but that is mere chance, and it does not happen
that easily in SQL 2005.

2) Try to remove the COLLATE clause. Adding to the query when it is not
needed can prevent indexes from being used and hamper performance.
Hi! Okay I wrote this:

ALTER VIEW view_results_7
AS
SELECT view_results_7a .*, table.MCC,
table.MNC, ...table.HPRP
FROM view_results_7a INNER JOIN
table ON view_results_7a .MCC = table.MCC AND view_results_7a .MNC =
table.MNC
WHERE view_results_7a .IMSI <>
IMSI_Blacklist. .tblIMSI_Stieri ng_Blacklist.IM SI
But there is still this error message:

Server: No 107, 16, state 3 procedure view_results_7
"The column prefix '%.*ls' does not match with a table name or alias
name used in the query."

Dec 19 '06 #6
(Co******@gmx.d e) writes:
Hi! Okay I wrote this:

ALTER VIEW view_results_7
AS
SELECT view_results_7a .*, table.MCC,
table.MNC, ...table.HPRP
FROM view_results_7a INNER JOIN
table ON view_results_7a .MCC = table.MCC AND view_results_7a .MNC =
table.MNC
WHERE view_results_7a .IMSI <>
IMSI_Blacklist. .tblIMSI_Stieri ng_Blacklist.IM SI
But there is still this error message:

Server: No 107, 16, state 3 procedure view_results_7
"The column prefix '%.*ls' does not match with a table name or alias
name used in the query."
What ugly environment are you using that only gives the unexpanaded
error message?

In any case, that IMSI_Blacklist. .tblIMSI_Stieri ng_Blacklist still
comes out of nowhere. You need to mention it in the FROM-JOIN clause.

Besides, you have something called "table" in the query above. Since
TABLE is a reserved keyword, I would expect that to yield a syntax error,
so I suspect that you are not even posting the query you are using.
--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Dec 19 '06 #7
Hi,
As suggested by Erland, table is a reserve keyword therefore you
can't have it in your query. I thought you are using table to
reference some pseodo table in the from clause so I used that because
you did not post the actual query. You have to post the actual query
for two reasons. Reason 1: I can see if you are using the 'table'
keyword in your query. If yeas, then it is obvious that was the error.
Number 2: if you have a table name in the select clause but missing
from the from clause then it will also cause error and also if you have
more tables in the from clause but not joining them appropriately in
the join or where clasue then it will be error too. So, the best thing
is if you post the actual query exactly as is.

Co******@gmx.de wrote:
Hi

Thanks for your answer, but the problem still exists. There is the same
error message like before.

ot*******@yahoo .com schrieb:

ALTER VIEW view_results_7
AS
SELECT TOP 100 PERCENT view_results_7a .*, table.MCC,
table.MNC, ...table.HPRP
FROM view_results_7a INNER JOIN
table ON view_results_7a .MCC = table.MCC
WHERE view_results_7a .IMSI <tblIMSI_Stieri ng_Blacklist.IM SI
ORDER BY view_results_7a .BegTime DESC


I have forgot to tell you that the table tblIMSI_Stierin g_Blacklist is
from another database but on the same server, so I have to write in
this way:

ALTER VIEW view_results_7
AS
SELECT TOP 100 PERCENT view_results_7a .*, table.MCC,
table.MNC, ...table.HPRP
FROM view_results_7a INNER JOIN
table ON view_results_7a .MCC = table.MCC
WHERE view_results_7a .IMSI <>
IMSI_Blacklist. dbo.tblIMSI_Sti ering_Blacklist .IMSI
ORDER BY view_results_7a .BegTime DESC

The error is still the same :-(
Dec 20 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3058
by: lawrence | last post by:
I've been bad about documentation so far but I'm going to try to be better. I've mostly worked alone so I'm the only one, so far, who's suffered from my bad habits. But I'd like other programmers to have an easier time understanding what I do. Therefore this weekend I'm going to spend 3 days just writing comments. Before I do it, I thought I'd ask other programmers what information they find useful. Below is a typical class I've...
3
1271
by: Zachary | last post by:
Hello, I'm relatively new at Python, and am slightly confused about how the try...except mechanism is supposed to work. I am just not sure how it would be used, as it just seems that it is another sort of loop. Is their any sort of example I could look at, that has an example of how it is applied? I haven't really seen any such full example. Thanks, And Sorry for the newbie Question, Zack
1
1681
by: Dirk Försterling | last post by:
Hi, sorry for reposting, but it seems my message just hit nothing but air. If I posted to the wrong list or did something else wrong with the message, please let me know. I really want to know what's going on but still found nothing. I do not know when and where the statements are produced that lead to the error messages. It seems they were generated by postgres internally but I cannot see when and why. How can
8
11242
by: RC | last post by:
In my Access 2002 form, I have a combo box and on the AfterUpdate event I use DoCmd.RunSQL ("UPDATE .... to update records in a table. When it starts to run I get a message "You are about to update 3 row(s)." Is there a way to prevent the message from popping up?
2
1373
by: Rajshekhar | last post by:
Hi all, Where can i get the complete details about the all types of errors and warnings that a C-compiler pops up..?? any pdfs or links or books to refer....! plz help me out.. Regards, Rajshekhar
5
1765
by: Patrick Dickey | last post by:
Hello, All! I'm modifying some source code that I downloaded from Planet-source-code a while back, and have a question about Try Catch statements. Basically, I'm wondering if I can do a Try with multiple Catch statements, or do I have to figure out how to embed Try Catch statements into my code. The scenario is this (and I'll paste the actual code at the bottom of this post). I'm modifying a web browser, and in the About Help box, it...
9
2229
by: Gustaf | last post by:
I'm confused about structured error handling. The following piece of code is a simplification of a class library I'm working on. It works, and it does what I want, but I'm still not convinced that I have been doing it right. I think I overdo it. Please have a look: -- using System; using System.IO;
10
3740
by: Rider | last post by:
Hi, simple(?) question about asp.net configuration.. I've installed ASP.NET 2.0 QuickStart Sample successfully. But, When I'm first start application the follow message shown. ========= Server Error in '/QuickStartv20' Application. -------------------------------------------------------------------------------- Configuration Error Description: An error occurred during the processing of a configuration file
10
2296
by: Anthony England | last post by:
(sorry for the likely repost, but it is still not showing on my news server and after that much typing, I don't want to lose it) I am considering general error handling routines and have written a sample function to look up an ID in a table. The function returns True if it can find the ID and create a recordset based on that ID, otherwise it returns false. **I am not looking for comments on the usefulness of this function - it is
4
1855
by: Steve | last post by:
I have read a couple articles online, read my Jesse Liberty book but I am still confused as to just what the best practices are for using exceptions. I keep changing how I'm working with them and it has now, after 15k lines of code resulted in a royal mess! It's my hope to ask some specific questions with scenario examples and that some of you might offer a little guidance or general suggestions. 1) string...
0
10455
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10173
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7547
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6788
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4116
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.