In an existing ssrs 2008 report, I want to change a hard coded value of 'P' to use a parameter value @serviceType.
When I execute the following sql in ssis 2012 manager, it runs correctly:
DECLARE @calendarID INT, @endYear SMALLINT
,@personID INT
, @serviceType varchar(10)
SET @endYear = 2017
SET @calendarID = (SELECT calendarid FROM TEST.dbo.Calendar WHERE name LIKE '%ash%' AND endYear = @endYear AND summerSchool = 1) --6153
SET @serviceType='S'
set @personID=999999
--end debug
IF OBJECT_ID('tempdb..#Homeroom') IS NOT NULL DROP TABLE #Homeroom
CREATE TABLE #Homeroom (personID INT,
studentNumber VARCHAR(15),
serviceType VARCHAR(1),
enrollmentID INT,
calendarID INT,
schoolID INT,
teacherPersonID INT,
teacherFirstName VARCHAR(50),
teacherMiddleName VARCHAR(50),
teacherLastName VARCHAR(50),
teacherName VARCHAR(104),
sectionTeacherDisplay VARCHAR(102),
roomID INT,
roomName VARCHAR(10),
courseID INT,
courseHomeroom BIT,
sectionID INT,
sectionHomeroom BIT,
rosterID INT,
trialID INT,
periodID INT,
periodScheduleID INT,
structureID INT,
termID INT)
INSERT INTO #Homeroom
EXEC CampusTEST.dbo.spHomeroom @endYear, @calendarID, @serviceType, @personID
Note:Here is how the @serviceType field is defined in the stored procedure:
CREATE PROCEDURE [dbo].[spHomeroom] (@endYear SMALLINT,
@calendarID VARCHAR(8000),
@serviceType VARCHAR(10),
@personID VARCHAR(8000))
However when I run the ssrs 2008 report setting the @servicetype parameter value to a 'text' field. I get truncation messages. The message I get is
'query execution failed for 'StudentsForReport' String or binary data would be truncated'
Thus can you tell me what I can do to the SSRS 2008 report so that it will run correctly?