I am new to Reporting Services and I need to kno how to add todays date to my
reports.
ThanksI found it in , Expressions, Globals, Execution Time
"Vincel2k2" wrote:
> I am new to Reporting Services and I need to kno how to add todays date to my
> reports.
> Thanks|||Just add a TextBox field and set its value to :
=System.DateTime.Now.ToString()
If you only want the date, you shoud use :
=System.DateTime.Now.ToShortDateString()
Showing posts with label todays. Show all posts
Showing posts with label todays. Show all posts
Friday, March 30, 2012
Wednesday, March 28, 2012
How do I "apply" a log to a database? Urgent...
Hello!
The database is giving the torn page error.
I have yesterday's backup and today's log file ldf.
How do I apply the log file to database? We didn't backup today's log...
Thanks for your help and attention.
Jorge C.
rdc02271@.yahoo.com
You don't. If you want to recover to a point in time which is between database backups, then you
should have proper operating measures for that requirement. I.e., do log backups. This is what log
backups are for.
What is the recovery mode for your database? If it is simple, then the information needed to recover
is most probably not in the ldf file anymore. If it is full or bulk logged, then you can give any of
the log reader tools a try. I have listed some on my links page.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Jorge C" <rdc02271@.yahoo.com> wrote in message news:uLIyLmbRFHA.204@.TK2MSFTNGP15.phx.gbl...
> Hello!
> The database is giving the torn page error.
> I have yesterday's backup and today's log file ldf.
> How do I apply the log file to database? We didn't backup today's log...
> Thanks for your help and attention.
> Jorge C.
> rdc02271@.yahoo.com
>
>
|||Jorge,
- Backup current transaction log WITH NO_TRUNCATE
- Restore full backup using NORECOVERY clause
- Restore transaction log backup WITH RECOVERY
See "Restoring a Database to a Prior State" in BOL.
AMB
"Jorge C" wrote:
> Hello!
> The database is giving the torn page error.
> I have yesterday's backup and today's log file ldf.
> How do I apply the log file to database? We didn't backup today's log...
> Thanks for your help and attention.
> Jorge C.
> rdc02271@.yahoo.com
>
>
|||Oops. Perhaps I didn't read the OP close enough. Assuming that you do indeed perform regular
transaction log backups as well as regular database backups, see Alejandro's post. (I read it as you
didn't perform transaction log backups *at all*, which is a big difference from not performed
*today's* transaction log backup yet.
You might want to check out:
http://www.karaszi.com/SQLServer/inf...suspect_db.asp
http://www.karaszi.com/SQLServer/inf...eral_times.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
news:uDMBL2bRFHA.3880@.tk2msftngp13.phx.gbl...
> You don't. If you want to recover to a point in time which is between database backups, then you
> should have proper operating measures for that requirement. I.e., do log backups. This is what log
> backups are for.
> What is the recovery mode for your database? If it is simple, then the information needed to
> recover is most probably not in the ldf file anymore. If it is full or bulk logged, then you can
> give any of the log reader tools a try. I have listed some on my links page.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Jorge C" <rdc02271@.yahoo.com> wrote in message news:uLIyLmbRFHA.204@.TK2MSFTNGP15.phx.gbl...
>
The database is giving the torn page error.
I have yesterday's backup and today's log file ldf.
How do I apply the log file to database? We didn't backup today's log...
Thanks for your help and attention.
Jorge C.
rdc02271@.yahoo.com
You don't. If you want to recover to a point in time which is between database backups, then you
should have proper operating measures for that requirement. I.e., do log backups. This is what log
backups are for.
What is the recovery mode for your database? If it is simple, then the information needed to recover
is most probably not in the ldf file anymore. If it is full or bulk logged, then you can give any of
the log reader tools a try. I have listed some on my links page.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Jorge C" <rdc02271@.yahoo.com> wrote in message news:uLIyLmbRFHA.204@.TK2MSFTNGP15.phx.gbl...
> Hello!
> The database is giving the torn page error.
> I have yesterday's backup and today's log file ldf.
> How do I apply the log file to database? We didn't backup today's log...
> Thanks for your help and attention.
> Jorge C.
> rdc02271@.yahoo.com
>
>
|||Jorge,
- Backup current transaction log WITH NO_TRUNCATE
- Restore full backup using NORECOVERY clause
- Restore transaction log backup WITH RECOVERY
See "Restoring a Database to a Prior State" in BOL.
AMB
"Jorge C" wrote:
> Hello!
> The database is giving the torn page error.
> I have yesterday's backup and today's log file ldf.
> How do I apply the log file to database? We didn't backup today's log...
> Thanks for your help and attention.
> Jorge C.
> rdc02271@.yahoo.com
>
>
|||Oops. Perhaps I didn't read the OP close enough. Assuming that you do indeed perform regular
transaction log backups as well as regular database backups, see Alejandro's post. (I read it as you
didn't perform transaction log backups *at all*, which is a big difference from not performed
*today's* transaction log backup yet.
You might want to check out:
http://www.karaszi.com/SQLServer/inf...suspect_db.asp
http://www.karaszi.com/SQLServer/inf...eral_times.asp
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in message
news:uDMBL2bRFHA.3880@.tk2msftngp13.phx.gbl...
> You don't. If you want to recover to a point in time which is between database backups, then you
> should have proper operating measures for that requirement. I.e., do log backups. This is what log
> backups are for.
> What is the recovery mode for your database? If it is simple, then the information needed to
> recover is most probably not in the ldf file anymore. If it is full or bulk logged, then you can
> give any of the log reader tools a try. I have listed some on my links page.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Jorge C" <rdc02271@.yahoo.com> wrote in message news:uLIyLmbRFHA.204@.TK2MSFTNGP15.phx.gbl...
>
Friday, March 9, 2012
how can NULL be equal to todays date (was "Weird Query behavior plz help")
I have a query that is behaving a little a weird. here is the example:
i have 1 table in this table i have 2 columns wich are date and time
DATE_DEBUT_PERIODE_FISCALE DATE_FIN_PERIODE_FISCALE
---------- --------
1/27/1997 2/27/1997
1/1/2005 2/6/2005
here is my query:
BEGIN
declare @.datefin_flag datetime, @.strip datetime
SELECT @.strip = dateadd(d,datediff(d,0,getdate()),0)
SELECT @.datefin_flag = DATE_FIN_PERIODE_FISCALE FROM DM_LKP_CALENDRIER_PERIODE_F
WHERE DATE_DEBUT_PERIODE_FISCALE < @.strip AND DATE_FIN_PERIODE_FISCALE = @.strip
--select @.datefin_flag
--select @.strip
IF(@.datefin_flag != @.strip)
RAISERROR('You cant run this',16,1)
END
Well this Query should return the raiserror it returns completes successfuly
since todays date is not the same as the date in the database.
if you select @.datefin_flag it returns NULL and if you select @.strip it brings back todays date how can NULL be equal to to todays date assuming that todays date is equal to NULL. ?Your code is checking for NOT equal. NULL is not equal to anything (including another NULL).
-PatP|||Crap...didnt think of that how would i go about fixing this based on my expresion since if it looks in the table and doesnt find anything.|||How about:IF(@.datefin_flag != @.strip OR @.datein_flag IS NULL)
RAISERROR('You cant run this',16,1)
END-PatP|||I'd write it this way...
IF NOT EXISTS( SELECT *
FROM DM_LKP_CALENDRIER_PERIODE_F
WHERE DATE_DEBUT_PERIODE_FISCALE < dateadd(d,datediff(d,0,getdate()),0)
AND DATE_FIN_PERIODE_FISCALE = dateadd(d,datediff(d,0,getdate()),0)
)
RAISERROR('You cant run this',16,1)
END
But I'd handle the raise a little differently
http://weblogs.sqlteam.com/brettk/archive/2004/05/25/1378.aspx|||Thanks alot Pat worked fine i realy apreciated.|||thanks also Brett that is a realy good alternative|||Your welcome...
But it's not really an alternative...
i have 1 table in this table i have 2 columns wich are date and time
DATE_DEBUT_PERIODE_FISCALE DATE_FIN_PERIODE_FISCALE
---------- --------
1/27/1997 2/27/1997
1/1/2005 2/6/2005
here is my query:
BEGIN
declare @.datefin_flag datetime, @.strip datetime
SELECT @.strip = dateadd(d,datediff(d,0,getdate()),0)
SELECT @.datefin_flag = DATE_FIN_PERIODE_FISCALE FROM DM_LKP_CALENDRIER_PERIODE_F
WHERE DATE_DEBUT_PERIODE_FISCALE < @.strip AND DATE_FIN_PERIODE_FISCALE = @.strip
--select @.datefin_flag
--select @.strip
IF(@.datefin_flag != @.strip)
RAISERROR('You cant run this',16,1)
END
Well this Query should return the raiserror it returns completes successfuly
since todays date is not the same as the date in the database.
if you select @.datefin_flag it returns NULL and if you select @.strip it brings back todays date how can NULL be equal to to todays date assuming that todays date is equal to NULL. ?Your code is checking for NOT equal. NULL is not equal to anything (including another NULL).
-PatP|||Crap...didnt think of that how would i go about fixing this based on my expresion since if it looks in the table and doesnt find anything.|||How about:IF(@.datefin_flag != @.strip OR @.datein_flag IS NULL)
RAISERROR('You cant run this',16,1)
END-PatP|||I'd write it this way...
IF NOT EXISTS( SELECT *
FROM DM_LKP_CALENDRIER_PERIODE_F
WHERE DATE_DEBUT_PERIODE_FISCALE < dateadd(d,datediff(d,0,getdate()),0)
AND DATE_FIN_PERIODE_FISCALE = dateadd(d,datediff(d,0,getdate()),0)
)
RAISERROR('You cant run this',16,1)
END
But I'd handle the raise a little differently
http://weblogs.sqlteam.com/brettk/archive/2004/05/25/1378.aspx|||Thanks alot Pat worked fine i realy apreciated.|||thanks also Brett that is a realy good alternative|||Your welcome...
But it's not really an alternative...
Subscribe to:
Posts (Atom)