Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

job token Expand / Collapse
Author
Message
Posted Tuesday, February 05, 2013 7:50 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Wednesday, April 16, 2014 9:25 AM
Points: 7,070, Visits: 12,523
The A in A-DBN is for Alerts. If you simply want the DB Name in the output of a standard job why would you need a token?

You would just do something like this:

PRINT N'Database name is ' + DB_NAME()



__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato

Believe you can and you're halfway there. --Theodore Roosevelt

Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein

The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein

1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
Post #1415850
Posted Tuesday, February 05, 2013 8:07 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Tuesday, February 11, 2014 12:02 PM
Points: 89, Visits: 233
Thanks

Then Hoe do you suggest to use token appropriatly or better usages

Thanks
Post #1415870
Posted Tuesday, February 05, 2013 9:42 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Wednesday, April 16, 2014 9:25 AM
Points: 7,070, Visits: 12,523
If you could clarify your original post about what you are trying to do...



__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato

Believe you can and you're halfway there. --Theodore Roosevelt

Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein

The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein

1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
Post #1415958
Posted Tuesday, February 05, 2013 10:18 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Tuesday, February 11, 2014 12:02 PM
Points: 89, Visits: 233
Thanks

I am just trying to understand and test how to use token, if you have more information about usages this will be helpful

Thanks lot
Post #1415982
Posted Tuesday, February 05, 2013 10:32 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Wednesday, April 16, 2014 9:25 AM
Points: 7,070, Visits: 12,523
To test the A- tokens, in a test environment of course:

- Setup a job that has the PRINT statement from Example A from the article I posted earlier.
PRINT N'Current database name is $(ESCAPE_SQUOTE(A-DBN))' ;

- Setup an Alert that fires for Database Errors with Severity 16 that starts the job you just created.
- Run this in a Query window which should prompt the job to execute, per the Alert:
RAISERROR('hi',16,1) WITH LOG;

- Check the job history to make sure it ran and check the step history to see the output of the PRINT statement.
- Now change databases and raise the error again.
- Again check the job history to make sure it ran and check the step history to see the output of the PRINT statement has changed to show the new database context.


__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato

Believe you can and you're halfway there. --Theodore Roosevelt

Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein

The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein

1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
Post #1415990
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse