Showing posts with label unfortunately. Show all posts
Showing posts with label unfortunately. Show all posts

Friday, March 23, 2012

Maintenance Job not working properly

Hi,

I an new to the forum.

I am having some problems where my maintenance job is not backing up the user databases in SQL2000. Unfortunately, I found out the hard way as my payroll in GP did not run properly and I had to do a restore from the BAK file.

I am receiving the following error msg in the event log

Status: Failed - Invoked on: 2006-04-11 22:00:02 - Message: The job failed. The owner () of job DB Backup Job for DB Maintenance Plan 'Daily Backup of User Databases' does not have server access.

I cannot find where and how the user permission was chmaged on this job. I would like some assistance with this problem.

thanks

Raymond

Hi,

Go to Jobs list under SQL Server Agent in the Enterprise Manager.

Find the job for the maintenance plan you have created. Name of the job will include the name of the maintenance plan.

If you open the job properties screen and activate the Steps tab. You will see the "run as user" in the advanced tab of the edit job steps screen.

Check this user for necessary credentials.

Also control the owner of the job in the main job properties screen.

Eralper

Monday, February 20, 2012

LTRIM in grouping

Hello All,

I am trying to ltrim a portion of multiple fields in a grouping. I am able to do it for one of them, but unfortunately there are several I have to do it for. If I use the following expression, it works for that one.

Code Snippet

=iif(Fields!BankNumber.Value="083"and Fields!TestName.Value="Inquiry Menu - Bank 083",LTRIM("Inquiry Menu"),Fields!TestName.Value)

However, if I try and do it for more than one it errors out. For example...

Code Snippet

=iif(Fields!BankNumber.Value="083"and Fields!TestName.Value="Inquiry Menu - Bank 083",LTRIM("Inquiry Menu"),Fields!TestName.Value)

OR iif(Fields!BankNumber.Value="083"and Fields!TestName.Value="Search Menu - Bank 083",LTRIM("Search Menu"),Fields!TestName.Value)

OR iif(Fields!BankNumber.Value="083"and Fields!TestName.Value="SEAX - Bank 083",LTRIM("SEAX"),Fields!TestName.Value)

Is there another way to arrange this so I can LTRIM each field group seperately?

Thanks,

Clint

It is not clear what exactly you are trying to do, but I'll take a crack at it. If I miss the mark, point me in the right direction.

I think that what you want is to remove the " - Bank 083" string from the end of your testname when the banknumber =083

The expression that you wrote does not exactly do that, and anyway there's a simpler way:

=Replace(Fields!TestName.Value, " - Bank 083", "")

What this does is return the testname with any instance of " - Bank 083" replaced with nothing.

What you wrote (in the first case) says "If the banknumber is 083 and the testname is "Inquiry Menu - Bank 083" then use the string "Inquiry Menu" with no leading spaces, otherwise use the testname.

So the value of that expression is either a literal string, or testname, which is also a string. You got a syntax error because there is no meaning to the expression "string1" OR "string2"

I took a few liberties in assuming characteristics of your data with the solution I offered. Specifically, I assume that only banknumber 083 has " - Bank 083" at the end of the testname.

You only mention the case of this one bank... Are all the other values for testname formatted correctly? If not, you'll probably want to make a more general solution using InStr and SubStr