Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
);
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
I am receiving this error in Qlik View.
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