%3CLINGO-SUB%20id%3D%22lingo-sub-1180614%22%20slang%3D%22en-US%22%3ERe%3A%20Elastic%20Jobs%20in%20Azure%20SQL%20Database%20%E2%80%93%20What%20and%20Why%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1180614%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20eagerly%20awaiting%20Part%204.%26nbsp%3B%20I%20am%20currently%20in%20the%20middle%20of%20setting%20up%20an%20elastic%20job.%26nbsp%3B%20The%20Microsoft%20documentation%20on%20the%20subject%20don't%20have%20many%26nbsp%3B%20practical%20examples%20on%20how%20to%20define%20an%20elastic%20job%20and%20the%20credentials.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1182131%22%20slang%3D%22en-US%22%3ERe%3A%20Elastic%20Jobs%20in%20Azure%20SQL%20Database%20%E2%80%93%20What%20and%20Why%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1182131%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20curious%20as%20to%20when%20you'd%20use%20elastic%20jobs%20vs.%20runbooks.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1177902%22%20slang%3D%22en-US%22%3EElastic%20Jobs%20in%20Azure%20SQL%20Database%20%E2%80%93%20What%20and%20Why%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1177902%22%20slang%3D%22en-US%22%3E%3CTABLE%20style%3D%22background-color%3A%20transparent%3B%20border-collapse%3A%20collapse%3B%20border-spacing%3A%200px%3B%20box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoeui%26amp%3Bquot%3B%2C%26amp%3Bquot%3Blato%26amp%3Bquot%3B%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Carial%2Csans-serif%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20width%3A%20100%25%3B%20word-spacing%3A%200px%3B%20border-style%3A%20double%3B%22%20border%3D%221%22%20width%3D%22100%25%22%3E%0A%3CTBODY%20style%3D%22box-sizing%3A%20border-box%3B%22%3E%0A%3CTR%20style%3D%22box-sizing%3A%20border-box%3B%22%3E%0A%3CTD%20width%3D%22100%25%22%20style%3D%22border-image-outset%3A%200%3B%20border-image-repeat%3A%20stretch%3B%20border-image-slice%3A%20100%25%3B%20border-image-source%3A%20none%3B%20border-image-width%3A%201%3B%20box-sizing%3A%20border-box%3B%20font-family%3A%20inherit%3B%20font-size%3A%2016px%3B%20font-weight%3A%20300%3B%20line-height%3A%201.7142%3B%20min-width%3A%2040px%3B%20word-break%3A%20normal%3B%20padding%3A%201px%205px%201px%205px%3B%20border%3A%201px%20solid%20%23c4c4c4%3B%22%3E%3CFONT%20style%3D%22box-sizing%3A%20border-box%3B%22%20color%3D%22%23ff0000%22%3EElastic%20Jobs%20are%20currently%20in%20public%20preview.%26nbsp%3B%20No%20whitelisting%20or%20extra%20steps%20are%20required%20to%20get%20started.%3C%2FFONT%3E%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Felastic-jobs-overview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EElastic%20Jobs%3C%2FA%3E%3CSPAN%3E%20is%20a%20feature%20of%20Azure%20SQL%20Database%20that%20lets%20you%20run%20a%20set%20of%20T%3CU%3E-%3C%2FU%3ESQL%20scripts%20against%20a%20collection%20of%20servers%20or%20databases%2C%20as%20a%20one-time%20job%2C%20in%20an%20ad-hoc%20manner%2C%20or%20according%20to%20a%20pre-defined%20schedule.%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%20This%20feature%20allows%20regular%20maintenance%20and%20any%20action%20that%20must%20be%20repeated%20%E2%80%93%20either%20across%20a%20set%20of%20databases%20or%20over%20time%2C%20much%20simpler.%20Set%20it%20up%20one%20time%2C%20and%20it%20will%20continue%20to%20run%20on%20any%20cadence%20you%20decide%2C%20across%20any%20scope%20you%20decide%2C%20for%20as%20long%20as%20you%20wish.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%E2%80%AF%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EI%20am%20releasing%20a%20series%20of%20posts%20that%20will%20demonstrate%20and%20explain%20the%20basics%20of%20setting%20up%20Elastic%20Jobs%20to%20work%20with%20a%20set%20of%20databases%2C%20including%20both%20a%20General%20Purpose%20database%20and%20a%20Hyperscale%20database.%20You%20will%20understand%20fundamental%20concepts%20needed%20to%20properly%20create%20Elastic%20Jobs%2C%20how%20to%20create%2C%20run%2C%20and%20schedule%20them%20using%20PowerShell%20or%20T-SQL%2C%20as%20well%20as%20some%20troubleshooting%20basics.%26nbsp%3B%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CFONT%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoeui%26amp%3Bquot%3B%2C%26amp%3Bquot%3Blato%26amp%3Bquot%3B%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Carial%2Csans-serif%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%20color%3D%22%23333333%22%3E%3CSTRONG%20style%3D%22box-sizing%3A%20border-box%3B%20font-weight%3A%20bold%3B%22%3E%3CFONT%20size%3D%225%22%20style%3D%22box-sizing%3A%20border-box%3B%22%3EWhat%20are%20Elastic%20Jobs%3F%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EElastic%20Jobs%20are%20a%20powerful%20tool%20that%20can%20be%20used%20to%20do%20a%20variety%20of%20automated%20tasks%20on%20a%20set%20of%20Azure%20SQL%20servers%20or%20Azure%20SQL%20databases.%26nbsp%3B%26nbsp%3B%20The%20tasks%20themselves%20must%20be%20things%20that%20can%20be%20achieved%20in%20T-SQL.%26nbsp%3B%20A%20sampling%20of%20the%20types%20of%20tasks%20one%20might%20choose%20to%20achieve%20includes%3A%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSPAN%3ESchema%20updates%20(e.g.%20add%20a%20column)%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EPartition%20maintenance%20(e.g.%20for%20a%20rolling-window%20partitioned%20table%20scenario)%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EStatistics%20updates%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EIndex%20maintenance%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EData%20maintenance%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoeui%26amp%3Bquot%3B%2C%26amp%3Bquot%3Blato%26amp%3Bquot%3B%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Carial%2Csans-serif%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%3E%3CFONT%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%20color%3D%22%23333333%22%3E%3CSTRONG%20style%3D%22box-sizing%3A%20border-box%3B%20font-weight%3A%20bold%3B%22%3E%3CFONT%20size%3D%225%22%20style%3D%22box-sizing%3A%20border-box%3B%22%3EWhen%20should%20I%20use%20Elastic%20Jobs%3F%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EYou%20should%20consider%20using%20Elastic%20Jobs%20whenever%3A%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSPAN%3EYou%20have%20a%20task%20that%20needs%20to%20be%20run%20regularly%20on%20a%20schedule%2C%20targeting%20one%20or%20more%20databases.%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EYou%20have%20a%20task%20that%20needs%20to%20be%20run%20once%2C%20but%20across%20multiple%20databases.%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CSPAN%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoeui%26amp%3Bquot%3B%2C%26amp%3Bquot%3Blato%26amp%3Bquot%3B%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Carial%2Csans-serif%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%3E%3CFONT%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%20color%3D%22%23333333%22%3E%3CSTRONG%20style%3D%22box-sizing%3A%20border-box%3B%20font-weight%3A%20bold%3B%22%3E%3CFONT%20size%3D%225%22%20style%3D%22box-sizing%3A%20border-box%3B%22%3EWhat%20database%20types%20can%20I%20target%20with%20Elastic%20Jobs%3F%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EYou%20can%20target%20most%20of%20the%20offerings%20available%20on%20Azure%20SQL%20Database%20with%20Elastic%20Jobs%2C%20this%20includes%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSPAN%3EBasic%2C%20Standard%2C%20and%20Premium%20tier%20database%20offerings%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EHyperscale%20databases%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EServerless%20databases%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EElastic%20Pools%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EManaged%20Instance%20will%20still%20use%20a%20limited%20version%20of%20%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%3E%20For%20more%20information%20about%20Elastic%20Jobs%20and%20SQL%20Agent%2C%20there%20is%20more%20documentation%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Fsql-database-job-automation-overview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehere%3C%2FA%3E.%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EIn%20my%20next%20post%2C%20I%20will%20cover%20fundamental%20concepts%20that%20you%20should%20understand%20before%20beginning%20to%20create%20Elastic%20Jobs.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EThis%20blog%20is%20part%20of%20a%20series%20about%20Elastic%20Jobs%20on%20Azure%20SQL%20Database.%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-sql-database%2Felastic-jobs-in-azure-sql-database-what-and-why%2Fba-p%2F1177902%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3EElastic%20Jobs%20in%20Azure%20SQL%20Database%20%E2%80%93%20What%20and%20Why%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3EFundamental%20Concepts%20for%20Elastic%20Jobs%20in%20Azure%20SQL%20Database%3C%2FLI%3E%0A%3CLI%3ECreating%20an%20Elastic%20Jobs%20Agent%2C%20Credentials%2C%20and%20Jobs%20for%20Azure%20SQL%20Database%20in%20PowerShell%3C%2FLI%3E%0A%3CLI%3ECreating%20an%20Elastic%20Jobs%20Agent%2C%20Credentials%2C%20and%20Jobs%20for%20Azure%20SQL%20Database%20in%20T-SQL%3C%2FLI%3E%0A%3CLI%3ERunning%2C%20Scheduling%20and%20Monitoring%20Elastic%20Jobs%20in%20Azure%20SQL%20Database%3C%2FLI%3E%0A%3CLI%3ETroubleshooting%20Common%20issues%20with%20Elastic%20Jobs%20in%20Azure%20SQL%20Database%3C%2FLI%3E%0A%3C%2FOL%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1177902%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsql-database%2Felastic-jobs-overview%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%20target%3D%22_blank%22%3EElastic%20Jobs%3C%2FA%3E%3CSPAN%3E%20is%20a%20feature%20of%20Azure%20SQL%20Database%20that%20lets%20you%20run%20a%20set%20of%20T-SQL%20scripts%20against%20a%20collection%20of%20servers%20or%20databases%2C%20as%20a%20one-time%20job%2C%20in%20an%20ad-hoc%20manner%2C%20or%20according%20to%20a%20pre-defined%20schedule.%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3B%20This%20feature%20allows%20regular%20maintenance%20and%20any%20action%20that%20must%20be%20repeated%20%E2%80%93%20either%20across%20a%20set%20of%20databases%20or%20over%20time%2C%20much%20simpler.%20Set%20it%20up%20one%20time%2C%20and%20it%20will%20continue%20to%20run%20on%20any%20cadence%20you%20decide%2C%20across%20any%20scope%20you%20decide%2C%20for%20as%20long%20as%20you%20wish%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1183595%22%20slang%3D%22en-US%22%3ERe%3A%20Elastic%20Jobs%20in%20Azure%20SQL%20Database%20%E2%80%93%20What%20and%20Why%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1183595%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Kate%2C%20thanks%20for%20the%20article.%20I%20was%20wondering%20if%20you%20know%20this%20is%20still%20currently%20in%20preview%20mode%2C%20or%20ready%20for%20production%20use%3F%20Will%20be%20great%20if%20you%20can%20share%20an%20official%20article%20that%20mentions%20that%20this%20has%20been%20moved%20out%20of%20preview.%20Thanks%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft
Elastic Jobs are currently in public preview.  The feature is ready and we are preparing to make it officially generally available.  No extra steps are required to get started.

 

Elastic Jobs is a feature of Azure SQL Database that lets you run a set of T-SQL scripts against a collection of servers or databases, as a one-time job, in an ad-hoc manner, or according to a pre-defined schedule.  This feature allows regular maintenance and any action that must be repeated – either across a set of databases or over time, much simpler. Set it up one time, and it will continue to run on any cadence you decide, across any scope you decide, for as long as you wish.

 

I am releasing a series of posts that will demonstrate and explain the basics of setting up Elastic Jobs to work with a set of databases, including both a General Purpose database and a Hyperscale database. You will understand fundamental concepts needed to properly create Elastic Jobs, how to create, run, and schedule them using PowerShell or T-SQL, as well as some troubleshooting basics. 

 

What are Elastic Jobs?

Elastic Jobs are a powerful tool that can be used to do a variety of automated tasks on a set of Azure SQL servers or Azure SQL databases.   The tasks themselves must be things that can be achieved in T-SQL.  A sampling of the types of tasks one might choose to achieve includes: 

  • Schema updates (e.g. add a column) 
  • Partition maintenance (e.g. for a rolling-window partitioned table scenario) 
  • Statistics updates 
  • Index maintenance 
  • Data maintenance 

When should I use Elastic Jobs?

You should consider using Elastic Jobs whenever: 

  • You have a task that needs to be run regularly on a schedule, targeting one or more databases. 
  • You have a task that needs to be run once, but across multiple databases. 

What database types can I target with Elastic Jobs?

You can target most of the offerings available on Azure SQL Database with Elastic Jobs, this includes:

  • Basic, Standard, and Premium tier database offerings
  • Hyperscale databases
  • Serverless databases
  • Elastic Pools

 

Managed Instance will still use a limited version of SQL Server Agent.  For more information about Elastic Jobs and SQL Agent, there is more documentation here.

 

In my next post, I will cover fundamental concepts that you should understand before beginning to create Elastic Jobs.

 

This blog is part of a series about Elastic Jobs on Azure SQL Database.

Code samples are also available on GitHub.

  1. Elastic Jobs in Azure SQL Database – What and Why
  2. Fundamental Concepts for Elastic Jobs in Azure SQL Database
  3. Creating an Elastic Jobs Agent, Credentials, and Jobs for Azure SQL Database in PowerShell
  4. Creating an Elastic Jobs Agent, Credentials, and Jobs for Azure SQL Database in T-SQL
  5. Running, Scheduling and Monitoring Elastic Jobs in Azure SQL Database
  6. Troubleshooting Common issues with Elastic Jobs in Azure SQL Database
7 Comments
Senior Member

I am eagerly awaiting Part 4.  I am currently in the middle of setting up an elastic job.  The Microsoft documentation on the subject don't have many  practical examples on how to define an elastic job and the credentials.  

Occasional Visitor

I'm curious as to when you'd use elastic jobs vs. runbooks.

Occasional Visitor

Hi Kate, thanks for the article. I was wondering if you know this is still currently in preview mode, or ready for production use? Will be great if you can share an official article that mentions that this has been moved out of preview. Thanks

Visitor

Hi @Kate_Smith.  It looks like you said a couple months ago that "we are preparing to make it officially generally available", but I don't know how long that process typically takes.  Any idea when it might be available to all?  I ask because I don't control our company's Azure subscription, and it's configured such that we can't use things that are only in preview.  I'd love to take advantage of elastic jobs to schedule several db jobs that we've got.

 

Thanks,

Brad 

Microsoft

@b-rad-G :

Elastic jobs is currently functionally complete and we are getting it ready for GA. But some security related work is being done as part of Azure wide effort and it is likely to delay the GA timeline for Elastic Jobs till the second half of this calendar year (CY 2020). Exact timeline is still being worked out. But the current public preview version is fully supported and any incidents will be treated similar to a GA’d product by the support team and the product team. We have large number of customers who are actively using the current public preview version of Elastic jobs.

Occasional Visitor

Administrating the jobs via the various stored procs, views, and tables has been painful and problematic versus the relatively seamless experience we'd all come to expect from Sql Server Agent. This is the first even semi-official movement I've heard on this product in years, and comes just as I've abandoned our implementation of Elastic Jobs in favor of other means.  MS has been relatively poor on communication relative to this key piece of functionality. I appreciate your blog post(s), but feel like MS abandoned us too long.

 

Microsoft

Hi All,

 

I created elastic job that store data of system table sys.syscomments. I am facing issue while inserting the output on the table by using elastic Job. i can see the job showing success but output data is not inserting on the table. I am executing the script select * from  sys.syscomments for each databases on the server.

I am using the below script:-

 


EXEC jobs.sp_add_job @job_name ='job_1', @description='get data';
exec JOBS.sp_update_jobstep
@job_name= 'job_1',
@step_name ='JobStep',
@command= N'SELECT
ROW_NUMBER() OVER(PARTITION BY DB_NAME(o.parent_object_id) ORDER BY ID) AS Rownumber,
@@servername AS ServerName,
DB_Name() AS DatabaseName,
s.name AS SchemaName,
o.name AS ObjectName,
sc.ID AS ObjectID,
o.type_desc,
CONVERT(VARCHAR(max), text) AS Code,
getdate() as created_Date,
FROM sys.syscomments sc
JOIN sys.objects o ON sc.id = o.object_id
JOIN sys.schemas s ON o.schema_id = s.schema_id',
@credential_name='ElasticJobUserCredential',
@target_group_name='ShardServerGroup1',
@output_type='SqlDatabase',
@output_credential_name='ElasticJobMasterCredential',
@output_server_name='sharepool1.database.windows.net',
@output_database_name='output database',
@output_schema_name='dbo',
@output_table_name='output table',
@retry_attempts = 1;

Could you help me how is there any solution?  Data is not inserting on the output table. table is showing blank after job succeeded.