Showing posts with label date. Show all posts
Showing posts with label date. Show all posts

Sunday, March 25, 2012

Archive SQL Server Logs..?

Hi Folks
is anyone knows that how can i archive(delete) log file for current date or
specific date'?
Thanx in advance
regards
--
Message posted via http://www.sqlmonster.comHi,
Did you mean SQL Server error logs or Tranasction log backups?
If it is Error log, sql server by itself keep only 6+1 (current) copies by
default. The old files will be deleted automatically.
If it is Transaction log backup files, then use database maintenance plan to
fix a archival day. So as old file(s) will be deleted automatically.
Thanks
Hari
SQL Server MVP
"sonny singh via SQLMonster.com" <forum@.nospam.SQLMonster.com> wrote in
message news:fa2cf9e684d741419c1094db51a9fea5@.SQLMonster.com...
> Hi Folks
> is anyone knows that how can i archive(delete) log file for current date
> or
> specific date'?
> Thanx in advance
> regards
> --
> Message posted via http://www.sqlmonster.com|||Hi Hari
You can change the number of error logs maintained by editing the Registry
for any instance. For the default instance, find the key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer and edit it by
adding a new value. Define the value with the name NumErrorLogs, and the
type REG_DWORD. Supply any initial value desired, but keep in mind that the
value you enter when editing the Registry will be in hexadecimal format.
For a named instance, you need to find the key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\<SQL Server
Instance Name>\MSSQLServer. Again, use the Edit feature of the Registry to
add a new value with the name NumErrorLogs of type REG_DWORD, and supply an
initial value in hexadecimal format.
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:Os1pMt2bFHA.3712@.TK2MSFTNGP09.phx.gbl...
> Hi,
> Did you mean SQL Server error logs or Tranasction log backups?
> If it is Error log, sql server by itself keep only 6+1 (current) copies by
> default. The old files will be deleted automatically.
> If it is Transaction log backup files, then use database maintenance plan
> to fix a archival day. So as old file(s) will be deleted automatically.
> Thanks
> Hari
> SQL Server MVP
> "sonny singh via SQLMonster.com" <forum@.nospam.SQLMonster.com> wrote in
> message news:fa2cf9e684d741419c1094db51a9fea5@.SQLMonster.com...
>> Hi Folks
>> is anyone knows that how can i archive(delete) log file for current date
>> or
>> specific date'?
>> Thanx in advance
>> regards
>> --
>> Message posted via http://www.sqlmonster.com
>

Archive SQL Server Logs..?

Hi Folks
is anyone knows that how can i archive(delete) log file for current date or
specific date??
Thanx in advance
regards
Message posted via http://www.droptable.com
Hi,
Did you mean SQL Server error logs or Tranasction log backups?
If it is Error log, sql server by itself keep only 6+1 (current) copies by
default. The old files will be deleted automatically.
If it is Transaction log backup files, then use database maintenance plan to
fix a archival day. So as old file(s) will be deleted automatically.
Thanks
Hari
SQL Server MVP
"sonny singh via droptable.com" <forum@.nospam.droptable.com> wrote in
message news:fa2cf9e684d741419c1094db51a9fea5@.droptable.co m...
> Hi Folks
> is anyone knows that how can i archive(delete) log file for current date
> or
> specific date??
> Thanx in advance
> regards
> --
> Message posted via http://www.droptable.com
|||Hi Hari
You can change the number of error logs maintained by editing the Registry
for any instance. For the default instance, find the key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\ MSSQLServer and edit it by
adding a new value. Define the value with the name NumErrorLogs, and the
type REG_DWORD. Supply any initial value desired, but keep in mind that the
value you enter when editing the Registry will be in hexadecimal format.
For a named instance, you need to find the key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\<SQL Server
Instance Name>\MSSQLServer. Again, use the Edit feature of the Registry to
add a new value with the name NumErrorLogs of type REG_DWORD, and supply an
initial value in hexadecimal format.
HTH
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:Os1pMt2bFHA.3712@.TK2MSFTNGP09.phx.gbl...
> Hi,
> Did you mean SQL Server error logs or Tranasction log backups?
> If it is Error log, sql server by itself keep only 6+1 (current) copies by
> default. The old files will be deleted automatically.
> If it is Transaction log backup files, then use database maintenance plan
> to fix a archival day. So as old file(s) will be deleted automatically.
> Thanks
> Hari
> SQL Server MVP
> "sonny singh via droptable.com" <forum@.nospam.droptable.com> wrote in
> message news:fa2cf9e684d741419c1094db51a9fea5@.droptable.co m...
>

Archive SQL Server Logs..?

Hi Folks
is anyone knows that how can i archive(delete) log file for current date or
specific date'?
Thanx in advance
regards
Message posted via http://www.droptable.comHi,
Did you mean SQL Server error logs or Tranasction log backups?
If it is Error log, sql server by itself keep only 6+1 (current) copies by
default. The old files will be deleted automatically.
If it is Transaction log backup files, then use database maintenance plan to
fix a archival day. So as old file(s) will be deleted automatically.
Thanks
Hari
SQL Server MVP
"sonny singh via droptable.com" <forum@.nospam.droptable.com> wrote in
message news:fa2cf9e684d741419c1094db51a9fea5@.SQ
droptable.com...
> Hi Folks
> is anyone knows that how can i archive(delete) log file for current date
> or
> specific date'?
> Thanx in advance
> regards
> --
> Message posted via http://www.droptable.com|||Hi Hari
You can change the number of error logs maintained by editing the Registry
for any instance. For the default instance, find the key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MS
SQLServer\MSSQLServer and edit it by
adding a new value. Define the value with the name NumErrorLogs, and the
type REG_DWORD. Supply any initial value desired, but keep in mind that the
value you enter when editing the Registry will be in hexadecimal format.
For a named instance, you need to find the key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Mi
crosoft SQL Server\<SQL Server
Instance Name>\MSSQLServer. Again, use the Edit feature of the Registry to
add a new value with the name NumErrorLogs of type REG_DWORD, and supply an
initial value in hexadecimal format.
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Hari Prasad" <hari_prasad_k@.hotmail.com> wrote in message
news:Os1pMt2bFHA.3712@.TK2MSFTNGP09.phx.gbl...
> Hi,
> Did you mean SQL Server error logs or Tranasction log backups?
> If it is Error log, sql server by itself keep only 6+1 (current) copies by
> default. The old files will be deleted automatically.
> If it is Transaction log backup files, then use database maintenance plan
> to fix a archival day. So as old file(s) will be deleted automatically.
> Thanks
> Hari
> SQL Server MVP
> "sonny singh via droptable.com" <forum@.nospam.droptable.com> wrote in
> message news:fa2cf9e684d741419c1094db51a9fea5@.SQ
droptable.com...
>

Thursday, March 22, 2012

appSettings from web.config cannot be referenced in emailed report subscription

Server Software:

SQL Server 2000 (all sp's up to date)

SSRS 2000 (all sp's up to date)

We have an error when a report subscription is sent via email.

Our report definitions reference a key in the web.config file so that we can have a single location to reference our department's name in all reports. Our department name changes frequently as our company is bought and sold and it is difficult to manually update 700+ reports.

In report designer we have a text field with the following value expression:

=System.Configuration.ConfigurationSettings.appSettings("Department").ToString()

Our web.config looks like this:

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

....extra settings truncated for brevity...

<appSettings>

<add key="Department" value="Report created by: Corporate Reporting and Analysis" />

</appSettings>

</configuration>

The reports work perfectly in every aspect accept when they are schedules to be emailed. When the email recipient receives the email (not matter what format, mhtl, pdf, etc...) the department string value is replaced with: #Error

Is this a bug with the report schedule and deilvery component? ..or is there a permission problem when accessing: System.Configuration.ConfigurationSettings.appSettings("Department").ToString() ?

Any help would be greatly appreciated.

Thank you

Well, I believe I solved the issue:

The report scheduling service is located in another folder:

C:\Program Files\Microsoft SQL Server\MSSQL\Reporting Services\ReportServer\bin\ReportingServicesService.exe

...and its configuration file is called:

ReportingServicesService.exe.config

All we had to do was modify this config file to match our web.config appSettings and "Presto!" it worked.

<configuration>

....extra settings truncated for brevity...

<appSettings>

<add key="Department" value="Report created by: Corporate Reporting and Analysis" />

</appSettings>

</configuration>

Also, remember to restart the "ReportServer" service after updating the ReportingServicesService.exe.config file in order to immediately reset the changes.

Tuesday, March 20, 2012

Approx date of next release

Does anyone have an approximate date of the next release of Reporting
Services?
Thanks in advance.
MarkReporting Services will be shipping along with Yukon. This is sometime in
the second half of next year most likely.
--
| From: "Mark" <mfield@.idonotlikespam.cce.umn.edu>
| Subject: Approx date of next release
| Date: Mon, 25 Oct 2004 08:55:27 -0500
| Lines: 8
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.3790.181
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.181
| Message-ID: <e#K3FppuEHA.2016@.TK2MSFTNGP15.phx.gbl>
| Newsgroups: microsoft.public.sqlserver.reportingsvcs
| NNTP-Posting-Host: x15-238.cce.umn.edu 134.84.15.238
| Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP0
8.phx.gbl!TK2MSFTNGP15.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.sqlserver.reportingsvcs:33045
| X-Tomcat-NG: microsoft.public.sqlserver.reportingsvcs
|
| Does anyone have an approximate date of the next release of Reporting
| Services?
|
| Thanks in advance.
|
| Mark
|
|
|

Saturday, February 25, 2012

Application need Date without Time

Hello,

We are managing industry standard application for solvent business need and it is working fine as per requirement but after replication we got some problem with date type data.

We have stored date data through application in dd/mm/yy format only, we didn't used time data so it is truncated in overall application but after implementation for replication (Merge Model) from multiple location some date field automatically get time with date value, so some time application not retrieving data from database owing to stored time with date.

How I can resolve this issue I didn't get any solution in short way.

Thanks in advance to every particapetience.

R.MallYou do know that datetime data always stores both. right?

If no time is supplied the default time is 0, or midnight.

Friday, February 24, 2012

appending two datetimes which were converted from strings

can anyone teach me how to append to datetime data into one.
the first is a date and the 2nd one is a time.

the time is converted from string.

thanksthe time is converted from string.

One method is to build a string containing both date and time in format is
'yyyymmdd hh:mm:ss'. SQL Server can then parse the string into a datetime
value. For example:

DECLARE
@.MyDate datetime,
@.MyTime datetime,
@.MyDateTime datetime

SET @.MyDate = '20061121'
SET @.MyTime = '12:13:14'

--concatenate date and time strings and assign to datetime data type
SET @.MyDateTime =
CONVERT(char(9), @.MyDate, 112) +
CONVERT(char(8), @.MyTime, 114)

--
Hope this helps.

Dan Guzman
SQL Server MVP

"paul_zaoldyeck" <niopaul@.yahoo.comwrote in message
news:1164084180.584403.64710@.k70g2000cwa.googlegro ups.com...

Quote:

Originally Posted by

can anyone teach me how to append to datetime data into one.
the first is a date and the 2nd one is a time.
>
the time is converted from string.
>
thanks
>

|||thanks for the answer.it worked.

i have another problem.

how can i convert a char(4) into a time where the datatype of the
column is datatime?

i think this is my only problem now.thanks
Dan Guzman wrote:

Quote:

Originally Posted by

Quote:

Originally Posted by

the time is converted from string.


>
One method is to build a string containing both date and time in format is
'yyyymmdd hh:mm:ss'. SQL Server can then parse the string into a datetime
value. For example:
>
DECLARE
@.MyDate datetime,
@.MyTime datetime,
@.MyDateTime datetime
>
SET @.MyDate = '20061121'
SET @.MyTime = '12:13:14'
>
--concatenate date and time strings and assign to datetime data type
SET @.MyDateTime =
CONVERT(char(9), @.MyDate, 112) +
CONVERT(char(8), @.MyTime, 114)
>
--
Hope this helps.
>
Dan Guzman
SQL Server MVP
>
"paul_zaoldyeck" <niopaul@.yahoo.comwrote in message
news:1164084180.584403.64710@.k70g2000cwa.googlegro ups.com...

Quote:

Originally Posted by

can anyone teach me how to append to datetime data into one.
the first is a date and the 2nd one is a time.

the time is converted from string.

thanks

|||paul_zaoldyeck wrote:

Quote:

Originally Posted by

how can i convert a char(4) into a time where the datatype of the
column is datatime?


Combine it with an appropriate date (today's date, a date from a
related record, whatever) in a similar fashion to the previous
answer. If you don't care about the date, then pick a fixed value
(e.g. January 1, 1970) and use that in all cases.|||The example below parses a string in hh:mm format into a datetime variable.
Note that a datetime always includes both date and time components so your
app will need to ignore the date part, if not needed. The date defaults to
'19000101'.

DECLARE
@.MyTimeString char(4),
@.MyDateTime datetime

SET @.MyTimeString = '1213' --hh:mm

SET @.MyDateTime = LEFT(@.MyTimeString, 2) + ':' + LEFT(@.MyTimeString, 2) +
':00'

SELECT @.MyDateTime

--
Hope this helps.

Dan Guzman
SQL Server MVP

"paul_zaoldyeck" <niopaul@.yahoo.comwrote in message
news:1164254851.864579.14760@.b28g2000cwb.googlegro ups.com...

Quote:

Originally Posted by

thanks for the answer.it worked.
>
i have another problem.
>
how can i convert a char(4) into a time where the datatype of the
column is datatime?
>
i think this is my only problem now.thanks
Dan Guzman wrote:

Quote:

Originally Posted by

Quote:

Originally Posted by

the time is converted from string.


>>
>One method is to build a string containing both date and time in format
>is
>'yyyymmdd hh:mm:ss'. SQL Server can then parse the string into a
>datetime
>value. For example:
>>
>DECLARE
> @.MyDate datetime,
> @.MyTime datetime,
> @.MyDateTime datetime
>>
>SET @.MyDate = '20061121'
>SET @.MyTime = '12:13:14'
>>
>--concatenate date and time strings and assign to datetime data type
>SET @.MyDateTime =
> CONVERT(char(9), @.MyDate, 112) +
> CONVERT(char(8), @.MyTime, 114)
>>
>--
>Hope this helps.
>>
>Dan Guzman
>SQL Server MVP
>>
>"paul_zaoldyeck" <niopaul@.yahoo.comwrote in message
>news:1164084180.584403.64710@.k70g2000cwa.googlegro ups.com...

Quote:

Originally Posted by

can anyone teach me how to append to datetime data into one.
the first is a date and the 2nd one is a time.
>
the time is converted from string.
>
thanks
>


>

Thursday, February 16, 2012

append date to exporting file name in SQL reporting service

When exporting a report to another format, say excel,PDF; the file name is always set to the report name. Our client has a requirement where whenever a user exports a report to pdf, the timestamp of when the data of the report was made should be appended in the filename. Is there a way to do this in Reporting Services ?

example : Report name : Testreport

Exported file should be : Testingreport-November-22-2007.pdf

please help me in this

Thanks
sukuTry here:

http://www.codeproject.com/sqlrs/PDFUsingSQLRepServices.asp|||I would suggest placing the timestamp inside of the report.
ie. "Report was generated November 22 2007 11:01am".
This way the client cannot change the "report date".

Because it is a PDF and thus you won't be editing the document you can sort it by "Date Modified" in explorer if you want to sort the files.

append date to exporting file name in SQL reporting service

When exporting a report to another format, say excel,PDF; the file name is always set to the report name. Our client has a requirement where whenever a user exports a report to pdf, the timestamp of when the data of the report was made should be appended in the filename. Is there a way to do this in Reporting Services ?

example : Report name : Testreport

Exported file should be : Testingreport-November-22-2007.pdf

please help me in this

Thanks
suku

Quote:

Originally Posted by sukumaster

When exporting a report to another format, say excel,PDF; the file name is always set to the report name. Our client has a requirement where whenever a user exports a report to pdf, the timestamp of when the data of the report was made should be appended in the filename. Is there a way to do this in Reporting Services ?

example : Report name : Testreport

Exported file should be : Testingreport-November-22-2007.pdf

please help me in this

Thanks
suku


Please post the over all operation you are trying to perform?
Are you trying to use shell script to ftp the file to any other server?
If Yes, then renaming a file would become easy!!

append current date to file name

Is there an easy way to append the current date to a file when using a flat file destination?

Easy when you know how

Hopefully this post will give you some pointers:

Dynamically set a logfile name
(http://blogs.conchango.com/jamiethomson/archive/2006/10/05/SSIS-Nugget_3A00_-Dynamically-set-a-logfile-name.aspx)

-Jamie

|||That was easy. Thanks.|||Perfect timing. Thanks for your post.

Append current date in exported report file name in PDF format in sql report server 2000

HI All

I want to append current date in exported reported file name.

I am using report viewer to diplay report . when i exported report in pdf format it ask me to save file at this time file name is same what ever i uploaded in report server.

when it ask me to save i want append current date to the file name.

like report file name is "testingdetail" then i want "testingdetail-November-27-2006.pdf"

Please help me in this

Thanks

Alpesh

It appears you can only alter the filename when using subscriptions. (link to related post)

If you find another way to achieve that behavior please let me know.

|||

Hi All

I found another way to append current date to Expoting report file name.

We have to overide the Reder method of reporting service

first we have to add web reference of reporting service then

put below code in button click event

private void lnkexport_Click(object sender, System.EventArgs e)

{

ReportingService rs = new ReportingService();

string reportPath=/SampleDetail/TestingDetail;

// TestingDetail report must uploded in SampleDetail folder in ReportManager

TestingDetailReport testingDetailParams =this.reportParams as TestingDetailReport;

ParameterValue[] parameters = new ParameterValue[1];

parameters[0] = new ParameterValue();

parameters[0].Name="parameterName";

parameters[0].Value=parameterValue;

Byte[] result = this.LoadReport(reportPath,parameters);

string fname = "TestingDetail" + " - " +DateTime.Today.ToString("MMMM-dd-yyyy");

Response.ClearContent();

Response.AddHeader("Content-Disposition","attachment; filename=" + fname);

Response.AddHeader("Content-Length", result.LongLength.ToString());

Response.ContentType="Application/pdf";

Response.BinaryWrite(result);

Response.Flush();

Response.Close();

}

private Byte[] LoadReport(string reportPath,ParameterValue[] parameter )

{

ReportingService rs = new ReportingService();

rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

string[] streamIDs;

string optionalString = null;

ParameterValue[]optionalparams =null;

Warning[] warning = null;

Byte[] output= rs.Render(reportPath,"PDF",null,null,parameter,null,null,out optionalString,out optionalString,out optionalparams,out warning,out streamIDs);

return output;

}

Thanks

Alpesh

Append a Date to the end of a table name

Is there a way to do so on the fly in SQL Server 2000? In other words, a field has the latest update date for the table and we wish to use this date as part of the table name. If so, please provide an example.
ddaveDo you really want to do this? It sounds like a receipe for disaster to me. The general idea would go something like:DECLARE @.fubar VARCHAR(500)
SELECT @.fubar = 'SELECT * INTO [foo' + Convert(CHAR(10), GetDate(), 121)
+ '] FROM foo'
EXECUTE (@.fubar)-PatP

Append @ExecutionTime to the Report File Name

I am trying to append the date to each snapshot of the report that is
deployed on a file share (e.g. RPT001 5-25-2005.xls).
I tried RPT001 @.ExecutionTime in the File Name of the subscription
definition but this deploys the report as: RPT001 @.ExecutionTime.xls
Anybody any ideas?
Thanks,
FlorinHi,
We would also like to do this - did you resolve?
Thanks,
--
Matt
"Florin" wrote:
> I am trying to append the date to each snapshot of the report that is
> deployed on a file share (e.g. RPT001 5-25-2005.xls).
> I tried RPT001 @.ExecutionTime in the File Name of the subscription
> definition but this deploys the report as: RPT001 @.ExecutionTime.xls
> Anybody any ideas?
> Thanks,
> Florin|||I have not figured how to do that.
"Matt" wrote:
> Hi,
> We would also like to do this - did you resolve?
> Thanks,
> --
> Matt
>
> "Florin" wrote:
> > I am trying to append the date to each snapshot of the report that is
> > deployed on a file share (e.g. RPT001 5-25-2005.xls).
> >
> > I tried RPT001 @.ExecutionTime in the File Name of the subscription
> > definition but this deploys the report as: RPT001 @.ExecutionTime.xls
> >
> > Anybody any ideas?
> >
> > Thanks,
> > Florin

Sunday, February 12, 2012

API Information

Can someone direct me to the APi information that would allow me to retrieve
the "Last Run date" of a report as well as the schedule information that
belongs to that report?>From Reporting Services BOL 2005:
Report.ExecutionTime
Gets the date and time that the report was generated.
Namespace: Microsoft.ReportingServices.ReportRendering
Assembly: Microsoft.ReportingServices.Processing (in
microsoft.reportingservices.processing.dll)
C#
public DateTime ExecutionTime { get; }
Regards,
Thiago Silva