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 5, 2013 7:50 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Saturday, August 23, 2014 8:34 AM
Points: 7,097, Visits: 12,601
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
Post #1415850
Posted Tuesday, February 5, 2013 8:07 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Thursday, June 26, 2014 1:17 AM
Points: 90, Visits: 239
Thanks

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

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


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Saturday, August 23, 2014 8:34 AM
Points: 7,097, Visits: 12,601
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
Post #1415958
Posted Tuesday, February 5, 2013 10:18 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Thursday, June 26, 2014 1:17 AM
Points: 90, Visits: 239
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 5, 2013 10:32 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Saturday, August 23, 2014 8:34 AM
Points: 7,097, Visits: 12,601
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
Post #1415990
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse