RE: Report Template Storage Location
--Run the following script against the System DB
Declare @statement as nvarchar(4000)
Declare @startposition as varchar(100)
Declare @smarttext varchar(8000)
Declare @i as integer
Declare @TemplateID char(30)
Declare @ScrnNbr char(5)
-- ====================================
-- set the TemplateID that you are looking for
SET @TemplateID = 'XXXXXXXXXXXXXXXXXX'
-- set the ScrnNbr of the Template ID (in case there are more than 1 Template with the same ID)
SET @ScrnNbr = 'XXXXX'
-- ====================================
Set @i =1
Set @smarttext =''
While @i < 1000000
Begin
Set @smarttext = @smarttext +
-- we need to convert the Image to varbinary, then to varchar
-- the result of the two conversions is LTrim-ed & RTrim-ed
-- it is converted in 100 char chunks - each of which is
-- separately Selected from the Template table
(Select Substring(LTrim(RTrim(
Convert(varchar(8000), Convert(varbinary(8000), SmartText))
)
),@i,100)
From Template
Where TemplateId = @TemplateID
AND ScrnNbr = @ScrnNbr
)
Set @i = @i +100
End
-- Using PRINT obeys cr/lf chars which are presumably in the data
Print @smarttext