Hi, I have stored procedure which is splitted on 2 parts.
CREATE PROCEDURE dbo.MyProcedure @ReportPart smallint AS IF @ReportPart = 0 BEGIN SELECT ColumnPart0Id, ColumnPart0Name, ColumnPart0Code FROM Table END ELSE IF @ReportPart = 1 BEGIN SELECT ColumnPart1Address, ColumnPart1PostCode, ColumnPart1Contractor FROM Table END
When I execute procedure in Telerik Report Designer (SQL Data Source) with
EXEC dbo.MyProcedure @ReportPart = 0
everything is ok, but after execute query
EXEC dbo.MyProcedure @ReportPart = 1
I have error "Can't setup column 'ColumnPart0Name'. This value violates limit MaxLength of this column".
It's weird because in @ReportPart = 1 there isn't any column name like ColumnPart0Name, it exists in first "IF" .
Is it bug?
Query works fine in SSMS.