Unplanned
Last Updated: 24 Aug 2021 10:15 by ADMIN
Jenner
Created on: 16 Aug 2021 11:15
Type: Bug Report
1
SQLDatasource does not support SQL statement with Table Variables when connected to MSSQL database

The SQL datasource incorrectly recognizes Table Variables in its SQL statement as parameters. The SQL wizard shows the "Configure data source parameter" page and fails to execute the statement.

PROBLEM DESCRIPTION:
A simple statement that uses Table Variables is shown below:
USE AdventureWorks
DECLARE @TestUDTs TABLE(AddressTypeID int NOT NULL, [Name] dbo.Name NOT NULL PRIMARY KEY CLUSTERED(AddressTypeID))
INSERT @TestUDTs(AddressTypeID, [Name]) SELECT AddressTypeID,[Name]
FROM Person.AddressType SELECT * FROM @TestUDTs

2 comments
ADMIN
Neli
Posted on: 24 Aug 2021 10:15

Hi Tommy,

You may review the Configuring Stored Procedure with Temporary Tables KB article. If this does not work for you, can you please send us an example query that can be executed in a sample console application but it does not work in the report designer?

Regards,
Neli
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.
Tommy
Posted on: 17 Aug 2021 21:43
I don't think it even support single variables... In our case when normally have to used a stored procedure for the SQLDataSource.