text: ﻿
  CREATE PROCEDURE [dbo].[app_ReportTemplate_Update] (
  	@RTID INT,
  	@ProgId INT,
  	@ReportName VARCHAR(150),
  	@DisplayFilters BIT,
  	@DOBFrom DATETIME,
  	@DOBTo DATETIME,
  	@AgeFrom INT,
  	@AgeTo INT,
  	@SchoolGrade VARCHAR(5),
  	@FirstName VARCHAR(50),
  	@LastName VARCHAR(50),
  	@Gender VARCHAR(1),
  	@EmailAddress VARCHAR(150),
  	@PhoneNumber VARCHAR(20),
  	@City VARCHAR(20),
  	@State VARCHAR(2),
  	@ZipCode VARCHAR(10),
  	@County VARCHAR(50),
  	@PrimaryLibrary INT,
  	@SchoolName VARCHAR(50),
  	@District VARCHAR(50),
  	@Teacher VARCHAR(20),
  	@GroupTeamName VARCHAR(20),
  	@SchoolType INT,
  	@LiteracyLevel1 INT,
  	@LiteracyLevel2 INT,
  	@Custom1 VARCHAR(50),
  	@Custom2 VARCHAR(50),
  	@Custom3 VARCHAR(50),
  	@Custom4 VARCHAR(50),
  	@Custom5 VARCHAR(50),
  	@RegistrationDateStart DATETIME,
  	@RegistrationDateEnd DATETIME,
  	@PointsMin INT,
  	@PointsMax INT,
  	@PointsStart DATETIME,
  	@PointsEnd DATETIME,
  	@EventCode VARCHAR(50),
  	@EarnedBadge INT,
  	@PhysicalPrizeEarned VARCHAR(50),
  	@PhysicalPrizeRedeemed BIT,
  	@PhysicalPrizeStartDate DATETIME,
  	@PhysicalPrizeEndDate DATETIME,
  	@ReviewsMin INT,
  	@ReviewsMax INT,
  	@ReviewTitle VARCHAR(150),
  	@ReviewAuthor VARCHAR(100),
  	@ReviewStartDate DATETIME,
  	@ReviewEndDate DATETIME,
  	@RandomDrawingName VARCHAR(50),
  	@RandomDrawingNum INT,
  	@RandomDrawingStartDate DATETIME,
  	@RandomDrawingEndDate DATETIME,
  	@HasBeenDrawn BIT,
  	@HasRedeemend BIT,
  	@PIDInc BIT,
  	@UsernameInc BIT,
  	@DOBInc BIT,
  	@AgeInc BIT,
  	@SchoolGradeInc BIT,
  	@FirstNameInc BIT,
  	@LastNameInc BIT,
  	@GenderInc BIT,
  	@EmailAddressInc BIT,
  	@PhoneNumberInc BIT,
  	@CityInc BIT,
  	@StateInc BIT,
  	@ZipCodeInc BIT,
  	@CountyInc BIT,
  	@PrimaryLibraryInc BIT,
  	@SchoolNameInc BIT,
  	@DistrictInc BIT,
  	@TeacherInc BIT,
  	@GroupTeamNameInc BIT,
  	@SchoolTypeInc BIT,
  	@LiteracyLevel1Inc BIT,
  	@LiteracyLevel2Inc BIT,
  	@Custom1Inc BIT,
  	@Custom2Inc BIT,
  	@Custom3Inc BIT,
  	@Custom4Inc BIT,
  	@Custom5Inc BIT,
  	@RegistrationDateInc BIT,
  	@PointsInc BIT,
  	@EarnedBadgeInc BIT,
  	@PhysicalPrizeNameInc BIT,
  	@PhysicalPrizeDateInc BIT,
  	@NumReviewsInc BIT,
  	@ReviewAuthorInc BIT,
  	@ReviewTitleInc BIT,
  	@ReviewDateInc BIT,
  	@RandomDrawingNameInc BIT,
  	@RandomDrawingNumInc BIT,
  	@RandomDrawingDateInc BIT,
  	@HasBeenDrawnInc BIT,
  	@HasRedeemendInc BIT,
  	@LastModDate DATETIME,
  	@LastModUser VARCHAR(50),
  	@AddedDate DATETIME,
  	@AddedUser VARCHAR(50),
  	@SDistrict VARCHAR(50),
  	@SDistrictInc BIT,
  	@TenID INT = 0,
  	@FldInt1 INT = 0,
  	@FldInt2 INT = 0,
  	@FldInt3 INT = 0,
  	@FldBit1 BIT = 0,
  	@FldBit2 BIT = 0,
  	@FldBit3 BIT = 0,
  	@FldText1 TEXT = '',
  	@FldText2 TEXT = '',
  	@FldText3 TEXT = '',
  	@Score1From INT = 0,
  	@Score1To INT = 0,
  	@Score1PctFrom INT = 0,
  	@Score1PctTo INT = 0,
  	@Score2From INT = 0,
  	@Score2To INT = 0,
  	@Score2PctFrom INT = 0,
  	@Score2PctTo INT = 0,
  	@Score1Inc BIT,
  	@Score2Inc BIT,
  	@Score1PctInc BIT,
  	@Score2PctInc BIT
  	)
  AS
  UPDATE ReportTemplate
  SET ProgId = @ProgId,
  	ReportName = @ReportName,
  	DisplayFilters = @DisplayFilters,
  	DOBFrom = @DOBFrom,
  	DOBTo = @DOBTo,
  	AgeFrom = @AgeFrom,
  	AgeTo = @AgeTo,
  	SchoolGrade = @SchoolGrade,
  	FirstName = @FirstName,
  	LastName = @LastName,
  	Gender = @Gender,
  	EmailAddress = @EmailAddress,
  	PhoneNumber = @PhoneNumber,
  	City = @City,
  	STATE = @State,
  	ZipCode = @ZipCode,
  	County = @County,
  	PrimaryLibrary = @PrimaryLibrary,
  	SchoolName = @SchoolName,
  	District = @District,
  	Teacher = @Teacher,
  	GroupTeamName = @GroupTeamName,
  	SchoolType = @SchoolType,
  	LiteracyLevel1 = @LiteracyLevel1,
  	LiteracyLevel2 = @LiteracyLevel2,
  	Custom1 = @Custom1,
  	Custom2 = @Custom2,
  	Custom3 = @Custom3,
  	Custom4 = @Custom4,
  	Custom5 = @Custom5,
  	RegistrationDateStart = @RegistrationDateStart,
  	RegistrationDateEnd = @RegistrationDateEnd,
  	PointsMin = @PointsMin,
  	PointsMax = @PointsMax,
  	PointsStart = @PointsStart,
  	PointsEnd = @PointsEnd,
  	EventCode = @EventCode,
  	EarnedBadge = @EarnedBadge,
  	PhysicalPrizeEarned = @PhysicalPrizeEarned,
  	PhysicalPrizeRedeemed = @PhysicalPrizeRedeemed,
  	PhysicalPrizeStartDate = @PhysicalPrizeStartDate,
  	PhysicalPrizeEndDate = @PhysicalPrizeEndDate,
  	ReviewsMin = @ReviewsMin,
  	ReviewsMax = @ReviewsMax,
  	ReviewTitle = @ReviewTitle,
  	ReviewAuthor = @ReviewAuthor,
  	ReviewStartDate = @ReviewStartDate,
  	ReviewEndDate = @ReviewEndDate,
  	RandomDrawingName = @RandomDrawingName,
  	RandomDrawingNum = @RandomDrawingNum,
  	RandomDrawingStartDate = @RandomDrawingStartDate,
  	RandomDrawingEndDate = @RandomDrawingEndDate,
  	HasBeenDrawn = @HasBeenDrawn,
  	HasRedeemend = @HasRedeemend,
  	PIDInc = @PIDInc,
  	UsernameInc = @UsernameInc,
  	DOBInc = @DOBInc,
  	AgeInc = @AgeInc,
  	SchoolGradeInc = @SchoolGradeInc,
  	FirstNameInc = @FirstNameInc,
  	LastNameInc = @LastNameInc,
  	GenderInc = @GenderInc,
  	EmailAddressInc = @EmailAddressInc,
  	PhoneNumberInc = @PhoneNumberInc,
  	CityInc = @CityInc,
  	StateInc = @StateInc,
  	ZipCodeInc = @ZipCodeInc,
  	CountyInc = @CountyInc,
  	PrimaryLibraryInc = @PrimaryLibraryInc,
  	SchoolNameInc = @SchoolNameInc,
  	DistrictInc = @DistrictInc,
  	TeacherInc = @TeacherInc,
  	GroupTeamNameInc = @GroupTeamNameInc,
  	SchoolTypeInc = @SchoolTypeInc,
  	LiteracyLevel1Inc = @LiteracyLevel1Inc,
  	LiteracyLevel2Inc = @LiteracyLevel2Inc,
  	Custom1Inc = @Custom1Inc,
  	Custom2Inc = @Custom2Inc,
  	Custom3Inc = @Custom3Inc,
  	Custom4Inc = @Custom4Inc,
  	Custom5Inc = @Custom5Inc,
  	RegistrationDateInc = @RegistrationDateInc,
  	PointsInc = @PointsInc,
  	EarnedBadgeInc = @EarnedBadgeInc,
  	PhysicalPrizeNameInc = @PhysicalPrizeNameInc,
  	PhysicalPrizeDateInc = @PhysicalPrizeDateInc,
  	NumReviewsInc = @NumReviewsInc,
  	ReviewAuthorInc = @ReviewAuthorInc,
  	ReviewTitleInc = @ReviewTitleInc,
  	ReviewDateInc = @ReviewDateInc,
  	RandomDrawingNameInc = @RandomDrawingNameInc,
  	RandomDrawingNumInc = @RandomDrawingNumInc,
  	RandomDrawingDateInc = @RandomDrawingDateInc,
  	HasBeenDrawnInc = @HasBeenDrawnInc,
  	HasRedeemendInc = @HasRedeemendInc,
  	LastModDate = @LastModDate,
  	LastModUser = @LastModUser,
  	AddedDate = @AddedDate,
  	AddedUser = @AddedUser,
  	SDistrict = @SDistrict,
  	SDistrictInc = @SDistrictInc,
  	TenID = @TenID,
  	FldInt1 = @FldInt1,
  	FldInt2 = @FldInt2,
  	FldInt3 = @FldInt3,
  	FldBit1 = @FldBit1,
  	FldBit2 = @FldBit2,
  	FldBit3 = @FldBit3,
  	FldText1 = @FldText1,
  	FldText2 = @FldText2,
  	FldText3 = @FldText3,
  	Score1From = @Score1From,
  	Score1To = @Score1To,
  	Score1PctFrom = @Score1PctFrom,
  	Score1PctTo = @Score1PctTo,
  	Score2From = @Score2From,
  	Score2To = @Score2To,
  	Score2PctFrom = @Score2PctFrom,
  	Score2PctTo = @Score2PctTo,
  	Score1Inc = @Score1Inc,
  	Score2Inc = @Score2Inc,
  	Score1PctInc = @Score1PctInc,
  	Score2PctInc = @Score2PctInc
  WHERE RTID = @RTID
  	AND TenID = @TenID
  