{"id":688,"date":"2018-08-17T01:06:20","date_gmt":"2018-08-16T23:06:20","guid":{"rendered":"https:\/\/sql.marcus-belz.de\/?p=688"},"modified":"2020-05-09T02:26:03","modified_gmt":"2020-05-09T00:26:03","slug":"ssis-vs-transact-sql-impersonation","status":"publish","type":"post","link":"https:\/\/sql.marcus-belz.de\/?p=688","title":{"rendered":"SSIS vs. SQL \u2013 Impersonation"},"content":{"rendered":"<h2>Overview<\/h2>\n<p><strong>SQL Server Integration Services<\/strong> (SSIS) is a very powerful graphical tool set belonging to the Microsoft BI Stack along with SQL Server, SQL Server Analysis Services (SSAS), SQL Server Reporting Services (SSRS), etc. It supports a broad variety of data migration, integration and transformation tasks. With that, you will find a bunch of good reasons why to utilize this tool set. However, there are a plenty of reasons why not to use SSIS. With Transact SQL (T-SQL) Microsoft provides with respect to transformation tasks an equivalent technique.<\/p>\n<p>This article belongs to a <a href=\"https:\/\/sql.marcus-belz.de\/?p=678\">series of articles<\/a> that are dealing with some important criteria for choosing the right technology(ies) \u2013 SSIS and\/or T-SQL.<\/p>\n<p>If an SQL Agent job is started, the individual steps in the job are executed out by default in the security context of the service account of the SQL Server Agent.<\/p>\n<p>When installing the SQL Server Agent, a service account must be specified under which the <strong>SQL Server Agent<\/strong> service is to be started. The user can choose between specifying an explicit account and selecting the local system account <strong>NT-AUTORITY\\System<\/strong>.<\/p>\n<p>When selecting a service account, the specified service account has a set of permissions that do very likely not match the requirements for all SQL Server Agent jobs.<\/p>\n<p>The local system account <strong>NT-AUTORITY\\System<\/strong> has extensive permissions to local resources and is a member of the Windows <strong>Administrators<\/strong> group. With that, SQL Server Agent Jobs can access resources that are not required or that may even have to be protected against unauthorized access. On the other hand, the system account generally has no or insufficient permissions to file shares, data sources, etc.<\/p>\n<p>According to the <strong>need-to-know principle<\/strong>, the user, under which a job is executed, should only have the necessary authorizations that are necessary for the completion of the task \u2013 here the execution of the SQL Server Agent job.<\/p>\n<p>Since numerous jobs are regularly configured in the SQL Server Agent, which all have very different tasks to accomplish and require specific resources, it is not possible to provide the service account with the appropriate rights according to the need-to-know principle.<\/p>\n<p>Microsoft offers a solution to this problem with the configuration of the executing user of a SQL Server Agent job step. The technical term for this is <strong>impersonation<\/strong>. Impersonation takes place at step level of SQL agent jobs in which SSIS packages are to be executed by specifying a so-called <strong>proxy user<\/strong>. Proxy users are configured in SQL Agent within the folder <strong>SQL Server Agent | Proxies | SSIS Package Execution<\/strong> and they reference a credential (<strong>Credential<\/strong> object) of an SQL Server instance, which is configured in the folder <strong>Security | Credentials<\/strong> of the respective instance. The credential is linked to a database login (SQL Server authentication or Windows authentication), which must be authorized according to the requirements in the database, file shares, etc.<\/p>\n<p>All artifact types that can be configured as a step support the <strong>Run As<\/strong> Property, except the type <strong>Transact-SQL Script<\/strong>. ETL processes that were created exclusively on the basis of Transact SQL can therefore not be impersonated via the SQL Server Agent.<\/p>\n<p>ETL processes that have an SSIS package as the starting point can be impersonated via the SQL Server Agent. Using an SSIS package as the starting point of an ETL process does not necessarily mean that the entire ETL route must be implemented in SSIS. The ETL process can also be implemented on the basis of Transact-SQL. In this case, the scripts, stored procedures, stored functions etc. must be executed via SQL command tasks in an SSIS package.<\/p>\n<h2>Summary<\/h2>\n<ul>\n<li>Using SSIS is mandatory when impersonation is required.<\/li>\n<li>Using SSIS Packages does not necessarily mean, that you have to develop ETL processes completely in SSIS. You can develop an ETL process based on Stored Procedures, etc. and execute them by SQL Tasks within SSIS Control Flows.<\/li>\n<li><\/li>\n<\/ul>\n<h2>Additional information in the Microsoft Online Documentation<\/h2>\n<ul>\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/ssms\/agent\/select-an-account-for-the-sql-server-agent-service?view=sql-server-ver15\" data-wplink-edit=\"true\">Select an Account for the SQL Server Agent Service<\/a><\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/ssms\/agent\/implement-sql-server-agent-security?view=sql-server-ver15\">Implement SQL Server Agent Security<\/a><\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/ssms\/agent\/create-a-sql-server-agent-proxy?view=sql-server-2017\">Create a SQL Server Agent Proxy<\/a><\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/relational-databases\/security\/authentication-access\/create-a-credential?view=sql-server-2017\">Create a Credential<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Overview SQL Server Integration Services (SSIS) is a very powerful graphical tool set belonging to the Microsoft BI Stack along with SQL Server, SQL Server Analysis Services (SSAS), SQL Server Reporting Services (SSRS), etc. It supports a broad variety of <a href=\"https:\/\/sql.marcus-belz.de\/?p=688\" class=\"read-more\">Read More &#8230;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,6],"tags":[15,19,10],"class_list":["post-688","post","type-post","status-publish","format-standard","hentry","category-all-languages","category-english","tag-ssis","tag-ssis-vs-sql","tag-t-sql"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>SSIS vs. SQL \u2013 Impersonation - Just another SQL blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/sql.marcus-belz.de\/?p=688\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SSIS vs. SQL \u2013 Impersonation - Just another SQL blog\" \/>\n<meta property=\"og:description\" content=\"Overview SQL Server Integration Services (SSIS) is a very powerful graphical tool set belonging to the Microsoft BI Stack along with SQL Server, SQL Server Analysis Services (SSAS), SQL Server Reporting Services (SSRS), etc. It supports a broad variety of Read More ...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/sql.marcus-belz.de\/?p=688\" \/>\n<meta property=\"og:site_name\" content=\"Just another SQL blog\" \/>\n<meta property=\"article:published_time\" content=\"2018-08-16T23:06:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-05-09T00:26:03+00:00\" \/>\n<meta name=\"author\" content=\"marcus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Geschrieben von\" \/>\n\t<meta name=\"twitter:data1\" content=\"marcus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data2\" content=\"3\u00a0Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/sql.marcus-belz.de\\\/?p=688#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sql.marcus-belz.de\\\/?p=688\"},\"author\":{\"name\":\"marcus\",\"@id\":\"https:\\\/\\\/sql.marcus-belz.de\\\/#\\\/schema\\\/person\\\/7b46a383907dc48ca44fae32ceb24744\"},\"headline\":\"SSIS vs. SQL \u2013 Impersonation\",\"datePublished\":\"2018-08-16T23:06:20+00:00\",\"dateModified\":\"2020-05-09T00:26:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/sql.marcus-belz.de\\\/?p=688\"},\"wordCount\":676,\"keywords\":[\"SSIS\",\"SSIS vs. SQL\",\"T-SQL\"],\"articleSection\":[\"All Languages\",\"English\"],\"inLanguage\":\"de\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/sql.marcus-belz.de\\\/?p=688\",\"url\":\"https:\\\/\\\/sql.marcus-belz.de\\\/?p=688\",\"name\":\"SSIS vs. SQL \u2013 Impersonation - Just another SQL blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/sql.marcus-belz.de\\\/#website\"},\"datePublished\":\"2018-08-16T23:06:20+00:00\",\"dateModified\":\"2020-05-09T00:26:03+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/sql.marcus-belz.de\\\/#\\\/schema\\\/person\\\/7b46a383907dc48ca44fae32ceb24744\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/sql.marcus-belz.de\\\/?p=688#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/sql.marcus-belz.de\\\/?p=688\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/sql.marcus-belz.de\\\/?p=688#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/sql.marcus-belz.de\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SSIS vs. SQL \u2013 Impersonation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/sql.marcus-belz.de\\\/#website\",\"url\":\"https:\\\/\\\/sql.marcus-belz.de\\\/\",\"name\":\"Just another SQL blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/sql.marcus-belz.de\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"de\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/sql.marcus-belz.de\\\/#\\\/schema\\\/person\\\/7b46a383907dc48ca44fae32ceb24744\",\"name\":\"marcus\",\"url\":\"https:\\\/\\\/sql.marcus-belz.de\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SSIS vs. SQL \u2013 Impersonation - Just another SQL blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/sql.marcus-belz.de\/?p=688","og_locale":"de_DE","og_type":"article","og_title":"SSIS vs. SQL \u2013 Impersonation - Just another SQL blog","og_description":"Overview SQL Server Integration Services (SSIS) is a very powerful graphical tool set belonging to the Microsoft BI Stack along with SQL Server, SQL Server Analysis Services (SSAS), SQL Server Reporting Services (SSRS), etc. It supports a broad variety of Read More ...","og_url":"https:\/\/sql.marcus-belz.de\/?p=688","og_site_name":"Just another SQL blog","article_published_time":"2018-08-16T23:06:20+00:00","article_modified_time":"2020-05-09T00:26:03+00:00","author":"marcus","twitter_card":"summary_large_image","twitter_misc":{"Geschrieben von":"marcus","Gesch\u00e4tzte Lesezeit":"3\u00a0Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/sql.marcus-belz.de\/?p=688#article","isPartOf":{"@id":"https:\/\/sql.marcus-belz.de\/?p=688"},"author":{"name":"marcus","@id":"https:\/\/sql.marcus-belz.de\/#\/schema\/person\/7b46a383907dc48ca44fae32ceb24744"},"headline":"SSIS vs. SQL \u2013 Impersonation","datePublished":"2018-08-16T23:06:20+00:00","dateModified":"2020-05-09T00:26:03+00:00","mainEntityOfPage":{"@id":"https:\/\/sql.marcus-belz.de\/?p=688"},"wordCount":676,"keywords":["SSIS","SSIS vs. SQL","T-SQL"],"articleSection":["All Languages","English"],"inLanguage":"de"},{"@type":"WebPage","@id":"https:\/\/sql.marcus-belz.de\/?p=688","url":"https:\/\/sql.marcus-belz.de\/?p=688","name":"SSIS vs. SQL \u2013 Impersonation - Just another SQL blog","isPartOf":{"@id":"https:\/\/sql.marcus-belz.de\/#website"},"datePublished":"2018-08-16T23:06:20+00:00","dateModified":"2020-05-09T00:26:03+00:00","author":{"@id":"https:\/\/sql.marcus-belz.de\/#\/schema\/person\/7b46a383907dc48ca44fae32ceb24744"},"breadcrumb":{"@id":"https:\/\/sql.marcus-belz.de\/?p=688#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/sql.marcus-belz.de\/?p=688"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/sql.marcus-belz.de\/?p=688#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/sql.marcus-belz.de\/"},{"@type":"ListItem","position":2,"name":"SSIS vs. SQL \u2013 Impersonation"}]},{"@type":"WebSite","@id":"https:\/\/sql.marcus-belz.de\/#website","url":"https:\/\/sql.marcus-belz.de\/","name":"Just another SQL blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/sql.marcus-belz.de\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"de"},{"@type":"Person","@id":"https:\/\/sql.marcus-belz.de\/#\/schema\/person\/7b46a383907dc48ca44fae32ceb24744","name":"marcus","url":"https:\/\/sql.marcus-belz.de\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/sql.marcus-belz.de\/index.php?rest_route=\/wp\/v2\/posts\/688","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sql.marcus-belz.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sql.marcus-belz.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sql.marcus-belz.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sql.marcus-belz.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=688"}],"version-history":[{"count":4,"href":"https:\/\/sql.marcus-belz.de\/index.php?rest_route=\/wp\/v2\/posts\/688\/revisions"}],"predecessor-version":[{"id":959,"href":"https:\/\/sql.marcus-belz.de\/index.php?rest_route=\/wp\/v2\/posts\/688\/revisions\/959"}],"wp:attachment":[{"href":"https:\/\/sql.marcus-belz.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=688"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sql.marcus-belz.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=688"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sql.marcus-belz.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=688"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}