Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

SQL for SQL*server gives error

I am trying to load data from a SQL*Server database using the following script:







SQL

SELECT id, name, abbrev, threshold FROM Timesheet.dbo."WORK_LOCATIONS";

I get a script error that says 'invalid column name 'threshold'.

Threshold is a valid column name for the SQL*Server table that I am using. I verified by running the same script in SQL*Server studio management express and it runs fine.

Is this error because 'threshold' is a reserved key word in QlikView?

Thanks,

-Viral



8 Replies
Anonymous
Not applicable
Author

When I look at my SQL load script it looks like this:

Load id
name,
abbrev,
threshold;
SQL SELECT id,
name,
abbrev,
threshold

FROM Timesheet.dbo."WORK_LOCATIONS";


Does this work?

Not applicable
Author

Dennis,

That is exactly how I have my script. It still gives the following error:

SQL Error:[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'threshold'.
SQL Scriptline:
SQL State:S0022
SQL SELECT id, name, abbrev, threshold
FROM Timesheet.dbo."WORK_LOCATIONS"

Anonymous
Not applicable
Author

Try dbl-quotes:
SQL SELECT id, name, abbrev, "threshold"
FROM Timesheet.dbo."WORK_LOCATIONS"

Not applicable
Author

Still no luck.

pgalvezt
Specialist
Specialist

I think you missed the semicolon in the last value.

can you put the error?

Not applicable
Author

I believe I have the semicolon.

I tried the following variation of the script with same results:

"Work Locations":

LOAD id, name, abbrev, "threshold";

SQL SELECT id, name, abbrev, "threshold" from Timesheet.dbo."WORK_LOCATIONS";

Still same error.







Anonymous
Not applicable
Author

I would suggest to use the wizard (Select button) and check the option Preceding load, normaly this always returns a usefull code.

Other things you can try is to use [threshold]

Or maybe

SQL SELECT *
FROM .....



Not applicable
Author

I did it all over again using the wizard and it works now.

Must have been a syntax error.

Thanks you all for your help.

-Viral