Skip to main content

System Status: 

How to Troubleshoot SQL Syntax

Use this checklist to resolve SQL syntax problems.

Note: If you don't know the SQL programming language, you can use QueryLink by clicking the Queries button in FinancialLink, EmployeeLink, Student/ Class Info tools, and DataLink.

The table referenced in the from clause cannot be found.

  • Check the spelling of the table name.
    • Did you spell the table name using the proper case? (Table names in the SQL-DSE database are uppercase.)
    • Does the table name require a dash or an underscore?
  • Does the table referenced in the SQL belong to the selected database?
  • Do you have all of the tables listed in the from clause?

You have entered an invalid data field name.

  • Is the data field name spelled correctly?
    • Are you using an underscore, not a dash, in the data field name?
    • Did you spell the field name using the proper case? (Field names in the SQL-DSE database are uppercase.)
  • Is the table associated with the data field name listed in the from clause?

You get an incorrect syntax near a word in your SQL statement.

  • Are you using commas correctly?
  • Is your select statement listing the modifying clause statement in the correct order?
  • Do you need a logical connector such as the keyword and in your where clause?
  • If comparing data, are you using the correct keyword?

An implicit conversion from datatype varchar to int is not allowed.

  • Have you included or excluded quotation marks for the value?

An operand-type clash such as int is incompatible with smalldatetime.

  • Have you left out quotation marks for the smalldatetime value?
For detailed instructions on SQL, enroll in a SQL training class. If you have questions, contact the Data Warehouse team.