Thursday, March 29, 2012
Change location of RS log files?
How can I change the location where the RS log files are
stored/created? The .config file seems to have options to change the
filename, but will this allow me to specify a different folder as
well?
We would like to put these files on a seperate hard drive from our
main application drive, in case the log files ever happen to grow
exponentially and fill the entire DB again.
Matt BrownEach of the following files for MS Reporting Services has a section called
RStrace that contains the settings for the log files.
...\ReportServer\bin\ReportingServicesService.exe.config
â?¦\ReportServer\web.config
â?¦\ReportManager\web.config
A default installation writes the log files to the directory where Reporting
Services is installed under the LogFiles folder. In order to change the
default location of the log files you need to add the following line under
the RStrace section for each of the above files. Once you have added the
directory line you will need to restart the ReportServer service.
<add name=â'Directoryâ' value=â'your dirâ' />
Example:
<RStrace>
<add name="Directory" value="d:\RSLogs" />
<add name="FileName" value="ReportServerService_" />
<add name="FileSizeLimitMb" value="32" />
<add name="KeepFilesForDays" value="14" />
<add name="Prefix" value="tid, time" />
<add name="TraceListeners" value="debugwindow, file"
/>
<add name="TraceFileMode" value="unique" />
<add name="Components" value="all" />
</RStrace>
Sunday, March 25, 2012
Change filename for flat file connection manager at runtime
I need to add the current date to the end of the filename of a flat file at runtime.
This was previously done with ActiveX script in SQL Server 2000.
oConn = DTSGlobalVariables.Parent.Connections("FlatFileConnectionManagerName")
oConn.DataSource = sNewFileName
oConn = Nothing
I would really appreciate if someone could give me some information on how to achieve this in SQL Server 2005.
Thanks in advance!
Regards,
Sara
Basically, use property expressions: http://blogs.conchango.com/jamiethomson/archive/2006/06/28/4156.aspx
-Jamie
|||
Hi Sara
I am working with SSIS packages and am having the same problem that you faced some time back
Am getting an error message in SSIS package in the following lines:
Set oConn = DTSGlobalVariables.Parent.Connections("Text File (Destination)")
oConn.DataSource = sFilename
Set oConn = Nothing
Could you tell me what you did to fix your code. Would really appreciate your time and response.
Thanks
Rishi...
|||Hi Rishi,
I did something to fix it then, but I would't solve it the same way today. The following example gets data from a file with a date in it. The date is always the current date so the Connection string needs to be updated to be able to read from the file.
I hope this gives you an idea of how to solve your problem!
Regards,
Sara
--
Script Task
Connection Manager Name: L:\VPKBA\Laddning\EDBKjerne\konto_YYYYMMDD.txt
File Name: L:\VPKBA\Laddning\EDBKjerne\konto.txt
Imports System
Imports System.IO
Imports System.Data
Imports Microsoft.SqlServer.Dts.Runtime
Public Class ScriptMain
Public Sub Main()
Dim theDate As String
Dim i As Integer
strPath = "L:\vpkba\laddning\EDBkjerne\"
theDate = Now.Year & IIf(CInt(Now.Month) < 10, "0" & Now.Month, Now.Month).ToString & IIf(CInt(Now.Day) < 10, "0" & Now.Day, Now.Day).ToString
For i = 0 To Dts.Connections.Count - 1
If Dts.Connections(i).Name.Contains("YYYYMMDD") Then
Dts.Connections.Item(i).ConnectionString = Dts.Connections.Item(i).Name.Replace("YYYYMMDD", theDate)
End If
Next
Dts.TaskResult = Dts.Results.Success
End Sub
End Class
Change filename for flat file connection manager at runtime
I need to add the current date to the end of the filename of a flat file at runtime.
This was previously done with ActiveX script in SQL Server 2000.
oConn = DTSGlobalVariables.Parent.Connections("FlatFileConnectionManagerName")
oConn.DataSource = sNewFileName
oConn = Nothing
I would really appreciate if someone could give me some information on how to achieve this in SQL Server 2005.
Thanks in advance!
Regards,
Sara
Basically, use property expressions: http://blogs.conchango.com/jamiethomson/archive/2006/06/28/4156.aspx
-Jamie
|||
Hi Sara
I am working with SSIS packages and am having the same problem that you faced some time back
Am getting an error message in SSIS package in the following lines:
Set oConn = DTSGlobalVariables.Parent.Connections("Text File (Destination)")
oConn.DataSource = sFilename
Set oConn = Nothing
Could you tell me what you did to fix your code. Would really appreciate your time and response.
Thanks
Rishi...
|||Hi Rishi,
I did something to fix it then, but I would't solve it the same way today. The following example gets data from a file with a date in it. The date is always the current date so the Connection string needs to be updated to be able to read from the file.
I hope this gives you an idea of how to solve your problem!
Regards,
Sara
--
Script Task
Connection Manager Name: L:\VPKBA\Laddning\EDBKjerne\konto_YYYYMMDD.txt
File Name: L:\VPKBA\Laddning\EDBKjerne\konto.txt
Imports System
Imports System.IO
Imports System.Data
Imports Microsoft.SqlServer.Dts.Runtime
Public Class ScriptMain
Public Sub Main()
Dim theDate As String
Dim i As Integer
strPath = "L:\vpkba\laddning\EDBkjerne\"
theDate = Now.Year & IIf(CInt(Now.Month) < 10, "0" & Now.Month, Now.Month).ToString & IIf(CInt(Now.Day) < 10, "0" & Now.Day, Now.Day).ToString
For i = 0 To Dts.Connections.Count - 1
If Dts.Connections(i).Name.Contains("YYYYMMDD") Then
Dts.Connections.Item(i).ConnectionString = Dts.Connections.Item(i).Name.Replace("YYYYMMDD", theDate)
End If
Next
Dts.TaskResult = Dts.Results.Success
End Sub
End Class
Change Filename creating database
I wish to change filename parameter depending on the root path of SQL Server :
C:\Program Files\Microsoft SQL Server\MSSQL.X\MSSQL where X>=1
I can find this root path by the following querie :
select SUBSTRING (physical_name,1,len(physical_name)-11) from sys.database_files where type_desc like 'LOG')
But i can't include the result in the create database command to be independant of the new root path in a the case of a deployment :
CREATE DATABASE [ACS] ON PRIMARY
(
NAME = N'ACS',
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\ACS.mdf',
SIZE = 5120KB,
MAXSIZE = UNLIMITED,
FILEGROWTH = 1024KB
)
LOG ON
(
NAME = N'ACS_log',
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\ACS_log.ldf',
SIZE = 3840KB,
MAXSIZE = 2048GB,
FILEGROWTH = 10%
)
Somebody can help me please ?
You will have to compose your SQlString first, then executing it with the help of sp_executesql or EXEC.HTH; Jens K. Suessmeyer.
http://www.sqlserver2005.de|||
Following your clear but short instruction, i write the next queries that don't work, have a correction ?
DECLARE @.prmname nvarchar(500)
DECLARE @.prmname2 nvarchar(500)
DECLARE @.prmpath nvarchar(500)
DECLARE @.prmpath2 nvarchar(500)
DECLARE @.SQLString nvarchar(500)
DECLARE @.ParmDefinition nvarchar(500);
/* Build the SQL string */
SET @.SQLString =
N'CREATE DATABASE [ACS] ON PRIMARY
(
NAME = @.name,
FILENAME = @.path,
SIZE = 5120KB,
MAXSIZE = UNLIMITED,
FILEGROWTH = 1024KB
)
LOG ON
(
NAME = @.name2,
FILENAME = @.path2,
SIZE = 3840KB,
MAXSIZE = 2048GB,
FILEGROWTH = 10%
)
COLLATE Latin1_General_BIN2';
SET @.ParmDefinition = N'@.path varchar(500),@.path2 varchar(500), @.name varchar(500), , @.name2 varchar(500)';
/* Execute the string with the parameter value. */
SET @.prmname = N'ACS';
SET @.prmpath = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\ACS.mdf';
SET @.prmname2 = N'ACS_log';
SET @.prmpath2 = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\ACS_log.ldf';
EXECUTE sp_executesql
@.SQLString,
@.ParmDefinition,
@.name= @.prmname,@.path=@.prmpath, @.name2= @.prmname2,@.path2=@.prmpath2;
DECLARE @.prmname nvarchar(500)
DECLARE @.prmname2 nvarchar(500)
DECLARE @.prmpath nvarchar(500)
DECLARE @.prmpath2 nvarchar(500)
DECLARE @.SQLString nvarchar(500)
DECLARE @.ParmDefinition nvarchar(500);
/* Execute the string with the parameter value. */
SET @.prmname = N'ACS';
SET @.prmpath = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\ACS.mdf';
SET @.prmname2 = N'ACS_log';
SET @.prmpath2 = N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\ACS_log.ldf';
/* Build the SQL string */
SET @.SQLString =
N'CREATE DATABASE [ACS] ON PRIMARY
(
NAME = ' + @.prmname + ',
FILENAME = ' + @.prmpath + ',
SIZE = 5120KB,
MAXSIZE = UNLIMITED,
FILEGROWTH = 1024KB
)
LOG ON
(
NAME = ' + @.prmname2 + ',
FILENAME = ' + @.prmpath2 + ',
SIZE = 3840KB,
MAXSIZE = 2048GB,
FILEGROWTH = 10%
)
COLLATE Latin1_General_BIN2'
EXECUTE sp_executesql @.SQLString
HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de
|||It's not working.
Incorrect Syntax for 'C' for DECLARE @.prmpath2 nvarchar(500)
Thursday, March 22, 2012
Change Default Filename with Export?
format (e.g. PDF), when I choose "Save" (instead of Open) the default
filename is listed as "ThisReportName.pdf". I need to have the "Save As"
name to be very specific (e.g. include the date and the customer ID, like
EN12345-9-27-07.pdf) and ready to save without any typing by the end-user.
I cannot find a URL parameter that will change the default filename (to be
saved) for an exported PDF. Is this possible with SSRS?
Thanks for any help or direction.On Sep 27, 12:10 pm, "Don Miller" <nos...@.nospam.com> wrote:
> When I use URL Access to render a report with specified parameters and a
> format (e.g. PDF), when I choose "Save" (instead of Open) the default
> filename is listed as "ThisReportName.pdf". I need to have the "Save As"
> name to be very specific (e.g. include the date and the customer ID, like
> EN12345-9-27-07.pdf) and ready to save without any typing by the end-user.
> I cannot find a URL parameter that will change the default filename (to be
> saved) for an exported PDF. Is this possible with SSRS?
> Thanks for any help or direction.
I believe that I answered this question in your other posting.
Regards,
Enrique Martinez
Sr. Software Consultant