Showing posts with label maintain. Show all posts
Showing posts with label maintain. Show all posts

Wednesday, March 28, 2012

How to determine when and if SQL Agent job will run again?

I need to determine when (maybe) and if (definitely) a SQL Agent job will run again. I need to maintain a table of the next pending execution for each job. I need to be able to update this table from within a SQL Agent job, but preferably from within an executing SSIS package in the job. Is this possible and if so, any suggestions on how?

Thanks

Hello, your question is really SQL agent related so you likely want to post in the mgt tools forum but I can say what I know. SQL agent jobs and job steps can be manipulate from TSQL/Stored procedures so in theory you could call those from an SSIS pacakge. For example, using the SSIS Execute SQL task.

The following looks like a good reference to SQL Agent SPs.

http://msdn2.microsoft.com/en-us/library/ms187763.aspx

Hope that helps

|||

Here is the solution in case anyone else has the issue. Get the NextRunDate property of the Job object in the Microsoft.SqlServer.Management.Smo.Agent namespace.

Monday, March 19, 2012

How to Design and Handle a Table with 30 Million rows

Hi

my requirement is like this - I need to maintain a subscription DB with more then 30 million rows in sql server thet keeps on increasing. I need to Update ,Insert and select from the Table. Problem is this has to be integrated with existing application where performance should not get effected. In this table application id and user number are unique.

Can anyone suggest what should be the approach.with minimum effect on performance of existig application.

ThanksIf you have proper indexes it should work with no problem.

Writing new queries could be challenging and will require more indexes. But with proper indexing you can manage it too.

Don't create clustered index if possible it will slow down update\insert and will require plenty free space on a Server.

Control updated number of records update, never update all table at once, it could bust transaction log and stop a Server.|||Can i select distinct values of a column from such a large table without using select distinct. Because this query runs very slowly on such a large table.|||Try to put index over this column.
In this case only index will be searched and not table itself.

Good Luck.

Friday, February 24, 2012

How to Delete Data on the Subscriber but Maintain It on the Publisher?

Hi,
We're using merge replication between a Sql Server 2000 Publisher and
Subscribers on PocketPCs running Sql Server Ce.
One part of our data sync scheme deals only with newly created data on
the PocketPC. For this we have an upload-only replication that sends
the new data from the device to the Publisher.
Due to storage constraints on the PcketPC, we want to delete the data
from these SQL CE tables after it has been sent to the Publisher, but I
am assuming that if we do so, upon the next replication this data will
then be deleted from the Publisher also.
We want to avoid that from happening - we want to delete the data on
the subscriber after it has been merged, but we also want to maintain
the data on the publisher.
Is there any way that we can delete the data from the subscriber but
still maintain it on the publisher.
Thanks,
JJ
create a sql account which has rights to insert and update, but not delete
on your publisher. Add this to the pal, and use this account in your SQL CE
program in the PublisherLogin parameter.
Now, for the articles which you wish the deletes not to make it to the
publisher, right click on the publication, select publication properties,
and then click on the articles tab. Click on the browse button to the right
of your table names, and select the merging changes tab. Ensure the delete
command is selected.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"JJ" <jjabour@.gmail.com> wrote in message
news:1127612785.479827.68040@.o13g2000cwo.googlegro ups.com...
> Hi,
> We're using merge replication between a Sql Server 2000 Publisher and
> Subscribers on PocketPCs running Sql Server Ce.
> One part of our data sync scheme deals only with newly created data on
> the PocketPC. For this we have an upload-only replication that sends
> the new data from the device to the Publisher.
> Due to storage constraints on the PcketPC, we want to delete the data
> from these SQL CE tables after it has been sent to the Publisher, but I
> am assuming that if we do so, upon the next replication this data will
> then be deleted from the Publisher also.
> We want to avoid that from happening - we want to delete the data on
> the subscriber after it has been merged, but we also want to maintain
> the data on the publisher.
> Is there any way that we can delete the data from the subscriber but
> still maintain it on the publisher.
> Thanks,
> JJ
>