Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
skipperdoll13
Contributor
Contributor

ErrorSource: Microsoft OLE DB Driver for SQL Server, ErrorMsg: Incorrect syntax near 'SMALLINT'.

This is my first time declaring a variable in SQL.   When I run the QVD that references the SQL code I receive the following error:

ErrorSource: Microsoft OLE DB Driver for SQL Server, ErrorMsg: Incorrect syntax near 'SMALLINT'.

TimePeriod:
noconcatenate
SQL Declare SMALLINT

Declare $(@CYFiscalPeriod) SMALLINT;
SET @CYFiscalPeriod = (
SELECT
max(FiscalMonthNumber)
FROM [D].[m].[DimTimePeriod] Where Month(GetDate()) = CalendarMonthNumber
);

3 Replies
Brett_Bleess
Former Employee
Former Employee

I believe you are on the wrong vendor's platform, this is something I would be asking on Microsoft platforms, as SQL and the Connectors are their tools, not ours, so they are the experts on deciphering the error you are receiving.  

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
skipperdoll13
Contributor
Contributor
Author

I am receiving this error in Qlik View.

 

Brett_Bleess
Former Employee
Former Employee

I understand that, but you need to understand we are not providing the connection driver to your SQL Database, you should be using the SQL Server Drive/Client for that, and that is where the error is actually occurring, we are just writing what the OLE DB connector is giving us, so folks have an opportunity to go research things.  That is why I said you need to be searching the Microsoft Forums, as that is the correct place for this one given the error is clearly pointing to the OLE DB Driver for SQL Server...  If you Google search that error, it should provide some further guidance, the fact the error ends up in our log is just something we are doing to help you not have to go looking in the Connector log for things...  Hopefully this helps you better understand, but you really need to either hit Microsoft SQL Server Connector forums or do a Google search and look for posts there that may provide a clue as to what you have done incorrectly in your query.  

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.