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
526 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 500 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Rebooting Witness SQL Server 2 23
Sql server Error message 3 13
SQL Server code help needed 14 25
Delete old Sharepoint backups 2 12
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

740 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