Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 ERROR

Author  Topic 

dtrivedi
Posting Yak Master

153 Posts

Posted - 2010-08-17 : 14:58:57
what does this error mean? i can't seem to decode it!


OLE DB provider "IBMDA400" for linked server "MAC" returned message "SQL0104: Token . was not valid. Valid tokens: , FROM INTO.
Cause . . . . . : A syntax error was detected at token .. Token . is not a valid token. A partial list of valid tokens is , FROM INTO. This list assumes that the statement is correct up to the token. The error may be earlier in the statement, but the syntax of the statement appears to be valid up to this point. Recovery . . . : Do one or more of the following and try the request again: -- Verify the SQL statement in the area of the token .. Correct the statement. The error could be a missing comma or quotation mark, it could be a misspelled word, or it could be related to the order of clauses. -- If the error token is <END-OF-STATEMENT>, correct the SQL statement because it does not end with a valid clause.".
Msg 7321, Level 16, State 2, Line 1
An error occurred while preparing the query "

SELECT
AARNCTMH.NMITMN,
AARNCTMH.NMDCC,

FROM AARDTAMAC.AARNCTMH
WHERE NMITMN IN (96782,96778,96777,
96776,96785,96784,
96783)
AND NMDCC<>84
AND(NMCNTY>2010 OR NMCNTY=2010 AND NMCNTM>=8)


" for execution against OLE DB provider "IBMDA400" for linked server "MAC".

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-08-17 : 15:21:52
as I see you'va an additional , at the end of column list. try removing it as


SELECT
AARNCTMH.NMITMN,
AARNCTMH.NMDCC
FROM AARDTAMAC.AARNCTMH
WHERE NMITMN IN (96782,96778,96777,
96776,96785,96784,
96783)
AND NMDCC<>84
AND(NMCNTY>2010 OR NMCNTY=2010 AND NMCNTM>=8)



------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

dtrivedi
Posting Yak Master

153 Posts

Posted - 2010-08-17 : 15:24:17
still getting this error

OLE DB provider "IBMDA400" for linked server "MAC" returned message "SQL5001: Column qualifier or table AARNCTMH undefined.
Cause . . . . . : Name AARNCTMH was used to qualify a column name or was specified as the operand of the RRN, HASHED_VALUE, PARTITION, NODENAME, NODENUMBER, DBPARTITIONNAME, DBPARTITIONNUM, DATAPARTITIONNAME, or DATAPARTITIONNUM scalar function. The name is not defined to be a table designator in this SQL statement or the table designator cannot be referenced where it is specified in the SQL statement. If a correlation name is specified following the table name in a FROM clause, the correlation name is considered to be the table designator. If a correlation name is not specified, the table name is considered to be the table designator. If using SQL naming and the table is qualified with authorization name, then the table designator is authorization-name.table-name. If the authorization name is not specified, the table designator is the implicit authorization name followed by the table name. Correlation from a nested table expression to a higher level table is only allowed if the TABLE keyword is used for the definition of the nested table expression. If the name is *N, a lateral correlation reference from a nested table expression is not allowed. You can not correlate to a table at a higher level than the nested table expression for one of the following reasons: -- The nested table expression contains a UNION, EXCEPT, or INTERSECT. -- The nested table expression uses the DISTINCT keyword in the SELECT clause. -- The nested table expression contains an ORDER BY clause. -- The correlated provider is in the same FROM clause as the nested table expression but is part of a RIGHT OUTER JOIN or RIGHT EXCEPTION JOIN. -- The nested table expression is in the FROM clause of another nested table expression that contains one of these restrictions. In an OLAP function, the ORDER OF table designator must refer to a table designator in the FROM clause of the subselect. Recovery . . . : Ensur...
Msg 7321, Level 16, State 2, Line 1
An error occurred while preparing the query "

SELECT
AARNCTMH.NMITMN,
AARNCTMH.NMDCC
FROM AARDTAMAC.AARNCTMH
WHERE NMITMN IN (96782,96778,96777,
96776,96785,96784,
96783)
AND NMDCC<>84
AND(NMCNTY>2010 OR NMCNTY=2010 AND NMCNTM>=8)




" for execution against OLE DB provider "IBMDA400" for linked server "MAC".
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-08-17 : 16:10:17
Remove prefix from field names
SELECT	NMITMN, NMDCC
FROM AARDTAMAC.AARNCTMH
WHERE NMITMN IN (96782,96778,96777, 96776,96785,96784, 96783)
AND NMDCC <> 84
AND (NMCNTY > 2010 OR NMCNTY = 2010 AND NMCNTM >= 8)

can remove that too if you're connecting to AARDTAMAC
Go to Top of Page

dtrivedi
Posting Yak Master

153 Posts

Posted - 2010-08-18 : 12:37:20
thank you so much
this was so frustrating but thank you for ypur help
Go to Top of Page
   

- Advertisement -