Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Server: Msg 107, Level 16, State 3, Line 1  The column prefix 'MSM_SVCCALLTABLE' does not match with a table name or alias name used in the query.

Posted on 2004-09-06
5
Medium Priority
?
542 Views
Last Modified: 2008-01-09
hello,

i get this error msg in QA [SQL2000 sp3a]

Server: Msg 107, Level 16, State 3, Line 1
The column prefix 'MSM_SVCCALLTABLE' does not match with a table name or alias name used in the query.

what does this mean??? i am not sure

this is the query i am trying to run...


SELECT     MSM_SVCCALLTABLE.PROJID AS Expr1, MSM_SVCCALLTABLE.CALLLEVEL AS Expr2, PROJTABLE.PROJID, PROJTABLE.STATUS
FROM         PROJTABLE INNER JOIN
                      MSM_SVCCALLTABLE ON PROJTABLE.PROJID = MSM_SVCCALLTABLE.PROJID
update projtable
set status = '4'
WHERE     (MSM_SVCCALLTABLE.CALLLEVEL = 7)



tables = msm_svccalltable, projtable
fields = msm_svccalltable - projid, calllevel
           projtable.projid, status

any ideas ????

thanks!
0
Comment
Question by:acetate
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 

Author Comment

by:acetate
ID: 11993125
sorry, to make this a bit clearer, how do i modify my script to work?? this is my end goal, and also to understand what i did wrong also.

thanks

0
 
LVL 15

Expert Comment

by:jdlambert1
ID: 11993151
QA sees your code as first a SELECT statement, then an UPDATE statement, and tries to execute one after the other. The error is generated by the UPDATE statement, because it refers to the MSM_SVCCALLTABLE table without including it in a FROM clause. You didn't describe what you want your UPDATE to do, but I'm guessing this is your intention:

UPDATE projtable SET status = '4'
FROM PROJTABLE INNER JOIN MSM_SVCCALLTABLE ON PROJTABLE.PROJID = MSM_SVCCALLTABLE.PROJID
WHERE MSM_SVCCALLTABLE.CALLLEVEL = 7
0
 
LVL 15

Accepted Solution

by:
jdlambert1 earned 2000 total points
ID: 11993162
BTW, if you're not familiar with it, one of QA's zillion excellent features is that you can select (highlight) any portion of code in the main window and tell it to execute (F5 or the green arrow button) and it will execute only that portion of code that's selected. It's a huge time-saver in troubleshooting T-SQL.
0
 
LVL 15

Expert Comment

by:jdlambert1
ID: 11993169
Another BTW, you can use aliases on table names, to avoid having to retype the whole name over and over. For example, the query I posted above can be modified to:

UPDATE p SET status = '4'
FROM PROJTABLE p
 INNER JOIN MSM_SVCCALLTABLE m ON p.PROJID = m.PROJID
WHERE m.CALLLEVEL = 7
0
 

Author Comment

by:acetate
ID: 11993175
champion!

thansk for the explanation + the script!

AAAA1!

cheers and beers from australia!


0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question