When I try to take a Transaction log backup of a database (Recovery model
set to Full), I get an option to truncate the transaction log by checking
"Remove inactive entries from transaction log" check box in the backup
dialog. This basically causes the inactive portion of the transaction log
(where transaction is completes, either rolled back are committed) to be
truncated. So this potentially leads to saving of huge amount of hard disk
space.
Now, when I setup log shipping is there any similar option I can set on the
primary database? After every transaction log backup I want inactive entries
from the transaction log to be removed. Is there any way to do this? If yes,
how?. If no, why is that so? Once the backup is taken inactive log entries
on the primary database are of no use to log ship, right?
Rathna RajThe option in the backup dialog is very misleading. It basically means that
EM does *not* send the WITH NO_TRUNCATE option. This option is designed for
doing an "emergency" backup in case the database is corrupted, and I have
communicated to MS that the dialog shouldn't be misleading in this way. The
normal way to do log backup is by not specifying this option (having the
checkbox checked (I believe), the default). If the log shipping was written
by a sane individual ;-), then it should not specify this option, I.e., you
already have the desired behavior. To be certain, use a Profiler trace to
see what is going on.
--
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"Rathna Raj" <RathnaRajT@.icode.com> wrote in message
news:%2365JEWJyDHA.1272@.TK2MSFTNGP12.phx.gbl...
> When I try to take a Transaction log backup of a database (Recovery model
> set to Full), I get an option to truncate the transaction log by checking
> "Remove inactive entries from transaction log" check box in the backup
> dialog. This basically causes the inactive portion of the transaction log
> (where transaction is completes, either rolled back are committed) to be
> truncated. So this potentially leads to saving of huge amount of hard disk
> space.
> Now, when I setup log shipping is there any similar option I can set on
the
> primary database? After every transaction log backup I want inactive
entries
> from the transaction log to be removed. Is there any way to do this? If
yes,
> how?. If no, why is that so? Once the backup is taken inactive log entries
> on the primary database are of no use to log ship, right?
> Rathna Raj
>|||Hi Rathna,
Thanks for your post. Based on my research, log shipping does done backup
log part, so transaction log should not be large. Therefore, it seems that
truncating the transaction log of the primary server manually in log
shipping is not necessary.
For more information regarding log shipping, please refer to the following
article on SQL Server Books Online. Also, the example in this article will
help describe how the log shipping works.
Topic; "Log Shipping"
Thanks for using MSDN newsgroup.
Regards,
Michael Shao
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.sql
Showing posts with label entries. Show all posts
Showing posts with label entries. Show all posts
Friday, March 30, 2012
Wednesday, March 28, 2012
Remove duplicate entries in a search
Is there a way to find only unique entries for a search. Currently I am
looking for jobs that a run for a give database, but the script will
return multiple job entries for the same job if the database is
reference many times in that job, (once per reference) is there a way
to weed out the duplicates?
Thanks.
-Matt-
<code>
select sj.name
from msdb.dbo.sysjobs sj join msdb.dbo.sysjobsteps sjs
on sj.job_id = sjs.job_id
where sjs.database_name = 'database_name' order by 'name'
</code>Try,
select sj.name
from msdb.dbo.sysjobs sj
where exists (
select *
from msdb.dbo.sysjobsteps sjs
where sjs.database_name = 'database_name' and sjs.job_id = sj.job_id
)
order by 'name'
go
You can also use "DISTINCT" in the original statement.
AMB
"Matthew" wrote:
> Is there a way to find only unique entries for a search. Currently I am
> looking for jobs that a run for a give database, but the script will
> return multiple job entries for the same job if the database is
> reference many times in that job, (once per reference) is there a way
> to weed out the duplicates?
> Thanks.
> -Matt-
>
> <code>
> select sj.name
> from msdb.dbo.sysjobs sj join msdb.dbo.sysjobsteps sjs
> on sj.job_id = sjs.job_id
> where sjs.database_name = 'database_name' order by 'name'
> </code>
>|||Thanks
Works perfectly.
looking for jobs that a run for a give database, but the script will
return multiple job entries for the same job if the database is
reference many times in that job, (once per reference) is there a way
to weed out the duplicates?
Thanks.
-Matt-
<code>
select sj.name
from msdb.dbo.sysjobs sj join msdb.dbo.sysjobsteps sjs
on sj.job_id = sjs.job_id
where sjs.database_name = 'database_name' order by 'name'
</code>Try,
select sj.name
from msdb.dbo.sysjobs sj
where exists (
select *
from msdb.dbo.sysjobsteps sjs
where sjs.database_name = 'database_name' and sjs.job_id = sj.job_id
)
order by 'name'
go
You can also use "DISTINCT" in the original statement.
AMB
"Matthew" wrote:
> Is there a way to find only unique entries for a search. Currently I am
> looking for jobs that a run for a give database, but the script will
> return multiple job entries for the same job if the database is
> reference many times in that job, (once per reference) is there a way
> to weed out the duplicates?
> Thanks.
> -Matt-
>
> <code>
> select sj.name
> from msdb.dbo.sysjobs sj join msdb.dbo.sysjobsteps sjs
> on sj.job_id = sjs.job_id
> where sjs.database_name = 'database_name' order by 'name'
> </code>
>|||Thanks
Works perfectly.
Remove Character from a table?
I have a table that has several entries.
Some of these entries have $ in them.
I don't want to manually go through all of these and remove the $, so I'm
wondering if there's an easy way to do this with a script or something?
Thanks,
Terry"Terry Matthews" wrote:
>I have a table that has several entries.
> Some of these entries have $ in them.
> I don't want to manually go through all of these and remove the $, so I'm
> wondering if there's an easy way to do this with a script or something?
> Thanks,
> Terry
I believe you want to update using the REPLACE function...
UPDATE SomeTable
SET SomeField = REPLACE(SomeField, '$', '')
WHERE SomeField LIKE '%$%'
Craig|||Terry Matthews (nospam@.hotmail.com) writes:
> I have a table that has several entries.
> Some of these entries have $ in them.
> I don't want to manually go through all of these and remove the $, so I'm
> wondering if there's an easy way to do this with a script or something?
UPDATE tbl
SET col = replace(col, '$', '')
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Great thanks, worked perfectly.
Just put in the column name instead of "somefield"
Thanks
Terry
"Craig Kelly" <cnkelly@.spamnomore.worldnet.att.net> wrote in message
news:gJS9f.11244$qk4.5037@.bgtnsc05-news.ops.worldnet.att.net...
> "Terry Matthews" wrote:
>
> I believe you want to update using the REPLACE function...
> UPDATE SomeTable
> SET SomeField = REPLACE(SomeField, '$', '')
> WHERE SomeField LIKE '%$%'
> Craig
>
Some of these entries have $ in them.
I don't want to manually go through all of these and remove the $, so I'm
wondering if there's an easy way to do this with a script or something?
Thanks,
Terry"Terry Matthews" wrote:
>I have a table that has several entries.
> Some of these entries have $ in them.
> I don't want to manually go through all of these and remove the $, so I'm
> wondering if there's an easy way to do this with a script or something?
> Thanks,
> Terry
I believe you want to update using the REPLACE function...
UPDATE SomeTable
SET SomeField = REPLACE(SomeField, '$', '')
WHERE SomeField LIKE '%$%'
Craig|||Terry Matthews (nospam@.hotmail.com) writes:
> I have a table that has several entries.
> Some of these entries have $ in them.
> I don't want to manually go through all of these and remove the $, so I'm
> wondering if there's an easy way to do this with a script or something?
UPDATE tbl
SET col = replace(col, '$', '')
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Great thanks, worked perfectly.
Just put in the column name instead of "somefield"
Thanks
Terry
"Craig Kelly" <cnkelly@.spamnomore.worldnet.att.net> wrote in message
news:gJS9f.11244$qk4.5037@.bgtnsc05-news.ops.worldnet.att.net...
> "Terry Matthews" wrote:
>
> I believe you want to update using the REPLACE function...
> UPDATE SomeTable
> SET SomeField = REPLACE(SomeField, '$', '')
> WHERE SomeField LIKE '%$%'
> Craig
>
Remove Character from a table?
I have a table that has several entries.
Some of these entries have $ in them.
I don't want to manually go through all of these and remove the $, so I'm
wondering if there's an easy way to do this with a script or something?
Thanks,
Terry
"Terry Matthews" wrote:
>I have a table that has several entries.
> Some of these entries have $ in them.
> I don't want to manually go through all of these and remove the $, so I'm
> wondering if there's an easy way to do this with a script or something?
> Thanks,
> Terry
I believe you want to update using the REPLACE function...
UPDATE SomeTable
SET SomeField = REPLACE(SomeField, '$', '')
WHERE SomeField LIKE '%$%'
Craig
|||Terry Matthews (nospam@.hotmail.com) writes:
> I have a table that has several entries.
> Some of these entries have $ in them.
> I don't want to manually go through all of these and remove the $, so I'm
> wondering if there's an easy way to do this with a script or something?
UPDATE tbl
SET col = replace(col, '$', '')
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
|||Great thanks, worked perfectly.
Just put in the column name instead of "somefield"
Thanks
Terry
"Craig Kelly" <cnkelly@.spamnomore.worldnet.att.net> wrote in message
news:gJS9f.11244$qk4.5037@.bgtnsc05-news.ops.worldnet.att.net...
> "Terry Matthews" wrote:
>
> I believe you want to update using the REPLACE function...
> UPDATE SomeTable
> SET SomeField = REPLACE(SomeField, '$', '')
> WHERE SomeField LIKE '%$%'
> Craig
>
Some of these entries have $ in them.
I don't want to manually go through all of these and remove the $, so I'm
wondering if there's an easy way to do this with a script or something?
Thanks,
Terry
"Terry Matthews" wrote:
>I have a table that has several entries.
> Some of these entries have $ in them.
> I don't want to manually go through all of these and remove the $, so I'm
> wondering if there's an easy way to do this with a script or something?
> Thanks,
> Terry
I believe you want to update using the REPLACE function...
UPDATE SomeTable
SET SomeField = REPLACE(SomeField, '$', '')
WHERE SomeField LIKE '%$%'
Craig
|||Terry Matthews (nospam@.hotmail.com) writes:
> I have a table that has several entries.
> Some of these entries have $ in them.
> I don't want to manually go through all of these and remove the $, so I'm
> wondering if there's an easy way to do this with a script or something?
UPDATE tbl
SET col = replace(col, '$', '')
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
|||Great thanks, worked perfectly.
Just put in the column name instead of "somefield"
Thanks
Terry
"Craig Kelly" <cnkelly@.spamnomore.worldnet.att.net> wrote in message
news:gJS9f.11244$qk4.5037@.bgtnsc05-news.ops.worldnet.att.net...
> "Terry Matthews" wrote:
>
> I believe you want to update using the REPLACE function...
> UPDATE SomeTable
> SET SomeField = REPLACE(SomeField, '$', '')
> WHERE SomeField LIKE '%$%'
> Craig
>
Remove Character from a table?
I have a table that has several entries.
Some of these entries have $ in them.
I don't want to manually go through all of these and remove the $, so I'm
wondering if there's an easy way to do this with a script or something?
Thanks,
Terry"Terry Matthews" wrote:
>I have a table that has several entries.
> Some of these entries have $ in them.
> I don't want to manually go through all of these and remove the $, so I'm
> wondering if there's an easy way to do this with a script or something?
> Thanks,
> Terry
I believe you want to update using the REPLACE function...
UPDATE SomeTable
SET SomeField = REPLACE(SomeField, '$', '')
WHERE SomeField LIKE '%$%'
Craig|||Terry Matthews (nospam@.hotmail.com) writes:
> I have a table that has several entries.
> Some of these entries have $ in them.
> I don't want to manually go through all of these and remove the $, so I'm
> wondering if there's an easy way to do this with a script or something?
UPDATE tbl
SET col = replace(col, '$', '')
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Great thanks, worked perfectly.
Just put in the column name instead of "somefield"
Thanks
Terry
"Craig Kelly" <cnkelly@.spamnomore.worldnet.att.net> wrote in message
news:gJS9f.11244$qk4.5037@.bgtnsc05-news.ops.worldnet.att.net...
> "Terry Matthews" wrote:
>
> I believe you want to update using the REPLACE function...
> UPDATE SomeTable
> SET SomeField = REPLACE(SomeField, '$', '')
> WHERE SomeField LIKE '%$%'
> Craig
>sql
Some of these entries have $ in them.
I don't want to manually go through all of these and remove the $, so I'm
wondering if there's an easy way to do this with a script or something?
Thanks,
Terry"Terry Matthews" wrote:
>I have a table that has several entries.
> Some of these entries have $ in them.
> I don't want to manually go through all of these and remove the $, so I'm
> wondering if there's an easy way to do this with a script or something?
> Thanks,
> Terry
I believe you want to update using the REPLACE function...
UPDATE SomeTable
SET SomeField = REPLACE(SomeField, '$', '')
WHERE SomeField LIKE '%$%'
Craig|||Terry Matthews (nospam@.hotmail.com) writes:
> I have a table that has several entries.
> Some of these entries have $ in them.
> I don't want to manually go through all of these and remove the $, so I'm
> wondering if there's an easy way to do this with a script or something?
UPDATE tbl
SET col = replace(col, '$', '')
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||Great thanks, worked perfectly.
Just put in the column name instead of "somefield"
Thanks
Terry
"Craig Kelly" <cnkelly@.spamnomore.worldnet.att.net> wrote in message
news:gJS9f.11244$qk4.5037@.bgtnsc05-news.ops.worldnet.att.net...
> "Terry Matthews" wrote:
>
> I believe you want to update using the REPLACE function...
> UPDATE SomeTable
> SET SomeField = REPLACE(SomeField, '$', '')
> WHERE SomeField LIKE '%$%'
> Craig
>sql
Remove Character from a table?
I have a table that has several entries.
Some of these entries have $ in them.
I don't want to manually go through all of these and remove the $, so I'm
wondering if there's an easy way to do this with a script or something?
Thanks,
Terry"Terry Matthews" wrote:
>I have a table that has several entries.
> Some of these entries have $ in them.
> I don't want to manually go through all of these and remove the $, so I'm
> wondering if there's an easy way to do this with a script or something?
> Thanks,
> Terry
I believe you want to update using the REPLACE function...
UPDATE SomeTable
SET SomeField = REPLACE(SomeField, '$', '')
WHERE SomeField LIKE '%$%'
Craig|||Terry Matthews (nospam@.hotmail.com) writes:
> I have a table that has several entries.
> Some of these entries have $ in them.
> I don't want to manually go through all of these and remove the $, so I'm
> wondering if there's an easy way to do this with a script or something?
UPDATE tbl
SET col = replace(col, '$', '')
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp|||Great thanks, worked perfectly.
Just put in the column name instead of "somefield"
Thanks
Terry
"Craig Kelly" <cnkelly@.spamnomore.worldnet.att.net> wrote in message
news:gJS9f.11244$qk4.5037@.bgtnsc05-news.ops.worldnet.att.net...
> "Terry Matthews" wrote:
>>I have a table that has several entries.
>> Some of these entries have $ in them.
>> I don't want to manually go through all of these and remove the $, so I'm
>> wondering if there's an easy way to do this with a script or something?
>> Thanks,
>> Terry
> I believe you want to update using the REPLACE function...
> UPDATE SomeTable
> SET SomeField = REPLACE(SomeField, '$', '')
> WHERE SomeField LIKE '%$%'
> Craig
>
Some of these entries have $ in them.
I don't want to manually go through all of these and remove the $, so I'm
wondering if there's an easy way to do this with a script or something?
Thanks,
Terry"Terry Matthews" wrote:
>I have a table that has several entries.
> Some of these entries have $ in them.
> I don't want to manually go through all of these and remove the $, so I'm
> wondering if there's an easy way to do this with a script or something?
> Thanks,
> Terry
I believe you want to update using the REPLACE function...
UPDATE SomeTable
SET SomeField = REPLACE(SomeField, '$', '')
WHERE SomeField LIKE '%$%'
Craig|||Terry Matthews (nospam@.hotmail.com) writes:
> I have a table that has several entries.
> Some of these entries have $ in them.
> I don't want to manually go through all of these and remove the $, so I'm
> wondering if there's an easy way to do this with a script or something?
UPDATE tbl
SET col = replace(col, '$', '')
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp|||Great thanks, worked perfectly.
Just put in the column name instead of "somefield"
Thanks
Terry
"Craig Kelly" <cnkelly@.spamnomore.worldnet.att.net> wrote in message
news:gJS9f.11244$qk4.5037@.bgtnsc05-news.ops.worldnet.att.net...
> "Terry Matthews" wrote:
>>I have a table that has several entries.
>> Some of these entries have $ in them.
>> I don't want to manually go through all of these and remove the $, so I'm
>> wondering if there's an easy way to do this with a script or something?
>> Thanks,
>> Terry
> I believe you want to update using the REPLACE function...
> UPDATE SomeTable
> SET SomeField = REPLACE(SomeField, '$', '')
> WHERE SomeField LIKE '%$%'
> Craig
>
Subscribe to:
Posts (Atom)