Showing posts with label old. Show all posts
Showing posts with label old. Show all posts

Friday, March 30, 2012

Job to truncate database records more than 15 days old

I have a SQL Server 2K db with some 10 tables and I want to setup a nightly job to truncate all db records which are more than 15 days old. Can anyone provide me with steps involved? Any help will be highly appreciated.You do have a datetime field with the record createion date on the tables, right?

And you do not have any relational integrity that may get in your way?|||Thats correct.|||Then create a stored procedure perform,ing the delete and let it run nightly. SQL Server Assistant has to be running for this to happen. Pretty staraightforward.sql

job to delete the old baks

How do I write a job to delete the old backup files. I do not want to use
Maintenance plan. I would like to write a sql job to perform this activity.
Is there any procedure for this
ThanksHi,
Have a look into the old post:-
http://groups.google.co.in/group/microsoft.public.sqlserver.server/browse_thread/thread/49bf865107573571/93d87002b75a5a0f?q=sql+server+script+to+delete+old+backup+files&rnum=6&hl=en#93d87002b75a5a0f
Thanks
Hari
SQL Server MVP
"Pari" <Pari@.discussions.microsoft.com> wrote in message
news:256D7D14-D04F-4195-A065-CA920A1F9AC6@.microsoft.com...
> How do I write a job to delete the old backup files. I do not want to use
> Maintenance plan. I would like to write a sql job to perform this
> activity.
> Is there any procedure for this
> Thanks

job to delete the old baks

How do I write a job to delete the old backup files. I do not want to use
Maintenance plan. I would like to write a sql job to perform this activity.
Is there any procedure for this
ThanksHi,
Have a look into the old post:-
http://groups.google.co.in/group/mi...3d87002b75a5a0f
Thanks
Hari
SQL Server MVP
"Pari" <Pari@.discussions.microsoft.com> wrote in message
news:256D7D14-D04F-4195-A065-CA920A1F9AC6@.microsoft.com...
> How do I write a job to delete the old backup files. I do not want to use
> Maintenance plan. I would like to write a sql job to perform this
> activity.
> Is there any procedure for this
> Thanks

job to delete the old baks

How do I write a job to delete the old backup files. I do not want to use
Maintenance plan. I would like to write a sql job to perform this activity.
Is there any procedure for this
Thanks
Hi,
Have a look into the old post:-
http://groups.google.co.in/group/mic...d87002b75a5a0f
Thanks
Hari
SQL Server MVP
"Pari" <Pari@.discussions.microsoft.com> wrote in message
news:256D7D14-D04F-4195-A065-CA920A1F9AC6@.microsoft.com...
> How do I write a job to delete the old backup files. I do not want to use
> Maintenance plan. I would like to write a sql job to perform this
> activity.
> Is there any procedure for this
> Thanks

Monday, March 12, 2012

job failed.

I have a job run on sql server at 8:00pm every night. But just one night, i got warning:

SQL Server Scheduled Job 'Pickup 16-day old Regulations' (0x3A7230FA2FAD3A4AB06CF41F871F957A) - Status: Failed - Invoked on: 2007-05-04 08:00:00 - Message: The job failed. Unable to determine if the owner (SDOM\sdmin) of job Pickup 16-day old Regulations has server access (reason: Could not obtain information about Windows NT group/user 'SDOM\sadmin'. [SQLSTATE 42000] (Error 8198)).

But on the next day, it worked fine.

Anybody help me? Thanks.Isolated network issue?|||Isolated network issue?
One of the reasons that I always set my job owners to a SQL Server login (not NT login).

Regards,

hmscott|||It could be network problem as next day until now it works fine. Maybe i need to change sql server login. I have another question, as this job was created by other people, if it failed. How can i run this job immediately. I tried to right click this job to start the job. But it didn't run.|||It could be network problem as next day until now it works fine. Maybe i need to change sql server login. I have another question, as this job was created by other people, if it failed. How can i run this job immediately. I tried to right click this job to start the job. But it didn't run.

What's the error message in the log file say?

What are your privileges on the server?

Also, the error you described in your original post could occur if the domain controller(s) was not available at the time the job started. This is a good reason to have at least two DCs in any network. Just make sure that LAN doesn't schedule both to be down at the same time.

Regards,

hmscott