14
Views
2
Comments
Incorrect syntax near the keyword 'IS'. Incorrect syntax near ','
Question

Dear All,

Please find the below query which will raise error.
PFB Query.

Error : Error in advanced query SQL2: Incorrect syntax near the keyword 'IS'. Incorrect syntax near ','. An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as "" or [] are not allowed. Change the alias to a valid name. 

Please help me to outcome of this


regards,
Hiren Rathod

2016-04-22 00-29-45
Nuno Reis
 
MVP

Hello.

From the message, I assume it can something as simple as defining an alias for the column inside IN:
SELECT TRY_CONVERT(INT, value) AS ConvertedValue

Was Neo's help useful? It changed a lot of things, not sure if all needed.

Note: If you want help with SQL code, better copy the SQL instead of pasting an image.



2025-08-07 06-30-56
Amit J
Champion

In SQL Server, double quotes "" are not valid string literals. SQL Server uses single quotes ' ' for string values. Double quotes are used for identifiers (like column names) in some SQL configurations.

So this part:  sqlCopyEditWHERE TRY_CONVERT(INT, value) <> ""

…is interpreted incorrectly and leads to: Incorrect syntax near ',' or empty alias names

Replace: sqlCopyEditWHERE TRY_CONVERT(INT, value) <> ""  

With:  sqlCopyEditWHERE TRY_CONVERT(INT, value) IS NOT NULL

This ensures that only successfully converted integers are returned.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.