{"id":198224,"date":"2013-10-20T00:15:03","date_gmt":"2013-10-19T20:15:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=198224"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=198224","title":{"rendered":"<span class=\"post_title\">ETL-\u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0432 Integration Services 2012<\/span>"},"content":{"rendered":"<div class=\"content html_format\">\n<h4>\u0417\u0430\u043f\u0430\u0441\u0430\u0435\u043c \u0432\u043f\u0440\u043e\u043a<\/h4>\n<p>  \u0418\u043d\u043e\u0433\u0434\u0430 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u044b\u0432\u0430\u044e\u0442 \u043d\u0443\u0436\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 SOAP \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442. <\/p>\n<p>  ETL-\u043f\u0440\u043e\u0446\u0435\u0441\u0441 (Extract \u2014 Transform \u2014 Load) \u044d\u0442\u043e \u0442\u0435\u0440\u043c\u0438\u043d \u0438\u0437 Business Intelligence \u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0431\u043e\u0440\u0430 \u0438 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u0434\u0430\u043d\u043d\u044b\u0445).<\/p>\n<p>  SOAP \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u043e\u0431\u043c\u0435\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u044b\u0435 WSDL \u2014 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u043d\u0430 \u0432 \u043c\u0438\u0440 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0435\u0445 ERP \u0441\u0438\u0441\u0442\u0435\u043c, \u043c\u043d\u043e\u0433\u0438\u0445 \u043e\u043d\u043b\u0430\u0439\u043d \u043f\u043e\u0440\u0442\u0430\u043b\u043e\u0432 \u0438 \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u044b\u0445 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0439. <\/p>\n<p>  \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e ETL \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043c\u043e\u0449\u043d\u0435\u0439\u0448\u0438\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 \u2014 MS Integration Services. <\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443. <\/p>\n<h4>\u0417\u0430\u0434\u0430\u0447\u0430<\/h4>\n<p>  \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043a\u0443\u0440\u0441\u0430\u0445 \u0432\u0430\u043b\u044e\u0442 \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a \u0440\u0443\u0431\u043b\u044e \u043d\u0430 \u043a\u0430\u0436\u0434\u0443\u044e \u0434\u0430\u0442\u0443 \u043f\u0440\u043e\u0448\u043b\u043e\u0433\u043e \u0433\u043e\u0434\u0430 \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438\u0445 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430. \u0426\u0435\u043d\u0442\u0440\u043e\u0431\u0430\u043d\u043a \u0420\u043e\u0441\u0441\u0438\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u2014 \u0432 \u0432\u0438\u0434\u0435 \u0432\u0435\u0431 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0441 \u043d\u0435\u043f\u043b\u043e\u0445\u0438\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c. <br \/>  \u041f\u043e\u0445\u043e\u0436\u0435 \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435. <br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442<\/h4>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 Business Intelligence Development Studio (\u0410 \u0441 \u043d\u0435\u0434\u0430\u0432\u043d\u0438\u0445 \u043f\u043e\u0440 \u2014 SQL Server Data Tools)<\/p>\n<p>  \u0412\u043e \u0442\u0443\u043b\u0431\u043e\u043a\u0441\u0435 \u0435\u0441\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 Web-service-task, \u0435\u0433\u043e \u043c\u044b \u0438 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0435\u043c \u043d\u0430 \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c. <br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/f87\/9f3\/875\/f879f3875886219f73ae2f5021ea470f.png\"\/><\/p>\n<p>  \u0412 \u0441\u0442\u0440\u043e\u043a\u0435 HttpConnection \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u2014 \u0432\u044b\u0431\u0440\u0430\u0432 NewConnection <br \/>  \u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c URL <a href=\"http:\/\/www.cbr.ru\/DailyInfoWebServ\/DailyInfo.asmx\">http:\/\/www.cbr.ru\/DailyInfoWebServ\/DailyInfo.asmx<\/a><br \/>  \u041a \u0441\u043b\u043e\u0432\u0443, \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0439\u0442\u0438 \u0442\u0443\u0434\u0430 \u2014 \u043d\u0435 \u0441\u0442\u0435\u0441\u043d\u044f\u0439\u0442\u0435\u0441\u044c. <\/p>\n<p>  WSDL \u2014 \u0444\u0430\u0439\u043b \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0442\u0430\u043c-\u0436\u0435, \u0432\u043e\u0442 \u043e\u043d <a href=\"http:\/\/www.cbr.ru\/DailyInfoWebServ\/DailyInfo.asmx?WSDL\">www.cbr.ru\/DailyInfoWebServ\/DailyInfo.asmx?WSDL<\/a><br \/>  \u0421\u043a\u0430\u0447\u0430\u0439\u0442\u0435 \u0438 \u0432\u044b\u0431\u0435\u0440\u0435\u0442\u0435 \u0435\u0433\u043e \u0432 \u0434\u0438\u0430\u043b\u043e\u0433\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438. <\/p>\n<p>  \u0412\u0441\u0435, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0443 Input<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/08f\/0bb\/65c\/08f0bb65c0b8ae562f2ef155408c06e5.png\" alt=\"image\"\/><\/p>\n<p>  \u0422\u0443\u0442 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0441\u0440\u0435\u0434\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0438 \u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u2014 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u043e\u043c. <br \/>  \u041d\u0430\u043c \u043d\u0443\u0436\u0435\u043d GetCourseOnDate \u2014 \u0432\u044b\u0434\u0430\u044e\u0449\u0438\u0439 DataSet \u043d\u0430 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c\u0443\u044e \u0434\u0430\u0442\u0443.<br \/>  \u041f\u0440\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u0442\u044b \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u2014 \u0432 \u043f\u043e\u043b\u0435 Value, \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435 \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u044d\u0442\u043e. <br \/>  Output c\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u0432 \u0444\u0430\u0439\u043b \u0441\u043e\u0437\u0434\u0430\u0432 \u043d\u043e\u0432\u043e\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 output \u2014 \u0432 \u0444\u0430\u0439\u043b output.xml<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/6be\/077\/9f4\/6be0779f4f7f482b75369b2113fc836a.png\" alt=\"image\"\/><\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u2014 \u0434\u0435\u043b\u043e \u043f\u043e\u0448\u043b\u043e. \u0424\u0430\u0439\u043b \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u2014 \u043a\u0443\u0440\u0441\u044b \u0432\u0430\u043b\u044e\u0442 \u0432\u044b\u0433\u044f\u043b\u044f\u0434\u044f\u0442 \u043a\u0430\u043a \u043a\u0443\u0440\u0441\u044b \u0432\u0430\u043b\u044e\u0442. <br \/>  \u0424\u043e\u0440\u043c\u0430\u0442 \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0432\u0430\u0442: diffgr \u0430\u0442\u0442\u0440\u0438\u0431\u0443\u0442\u044b, \u0438\u043d\u043b\u0430\u0439\u043d-\u0441\u0445\u0435\u043c\u0430. \u042d\u0442\u043e XML \u0432\u044b\u0434\u0430\u0447\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 Dataset. <\/p>\n<p>  \u0412 BI-\u0441\u0442\u0443\u0434\u0438\u0438 \u0435\u0441\u0442\u044c XML-Source \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0440 \u2014 \u043e\u043d \u0432\u044b\u0434\u0430\u0435\u0442 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0438 \u043f\u043e\u043f\u044b\u0442\u043a\u0435 \u043d\u0430\u0442\u0440\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u0442\u0430\u043a\u043e\u0439 \u0444\u0430\u0439\u043b. (\u0421\u0445\u0435\u043c\u0443 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442). <\/p>\n<p>  \u041f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u043f\u043e\u0441\u043b\u0435 Web Service Task \u2014 Skript Task. <\/p>\n<h4>Workaround<\/h4>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">   object rawConnection = Dts.Connections[&quot;output&quot;].AcquireConnection(Dts.Transaction);             DataSet CoursesFile = new DataSet();            string filePath = (string)rawConnection;            object rawConnection2 = Dts.Connections[&quot;output2&quot;].AcquireConnection(Dts.Transaction);            string filePath_Out = (string)rawConnection2;             object rawConnection3 = Dts.Connections[&quot;output.xsd&quot;].AcquireConnection(Dts.Transaction);            string filePath_Schema = (string)rawConnection3;             CoursesFile.ReadXml(@filePath);             CoursesFile.AcceptChanges();             CoursesFile.WriteXmlSchema(@filePath_Schema);             CoursesFile.WriteXml(@filePath2); <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0421\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 C#, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0441\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 .net \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0438 2012 VisualStudio. <br \/>  \u042f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0432 \u043d\u0430\u0447\u0430\u043b\u043e<b> using System.Xml;<\/b><br \/>  \u041e\u0431\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u2014 \u044f \u0441\u043e\u0437\u0434\u0430\u043b \u0435\u0449\u0435 2, \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u0445\u0435\u043c\u044b \u0438 \u0434\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430. <\/p>\n<p>  \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0447\u0438\u0441\u0442\u044b\u0439 XML \u2014 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f acceptChanges();<\/p>\n<h4>Reconsidering the Beginning<\/h4>\n<p>  \u041d\u0435\u043f\u043b\u043e\u0445\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0431\u0440\u0430\u0442\u044c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0434\u0430\u0442 \u2014 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u0443\u0440\u0441\u044b \u0432\u0430\u043b\u044e\u0442, \u0430 \u043f\u043e\u0442\u043e\u043c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c, \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0432 \u043a\u0443\u0440\u0441\u044b \u043f\u043e\u043b\u0435\u043c \u0434\u0430\u0442\u0430, \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445. <\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0435 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435, \u043e\u043d\u043e \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0438 \u0435\u0449\u0435 \u043d\u0435 \u0440\u0430\u0437 \u2014 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. <\/p>\n<p>  \u042f \u0441\u043e\u0437\u0434\u0430\u044e \u0441\u0432\u043e\u0435\u0439 \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u0435\u0439 \u043f\u043e\u0434\u0441\u043c\u043e\u0442\u0435\u043d\u043d\u043e\u0433\u043e \u0432 \u0441\u0435\u0442\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u0432\u043e\u0442 \u043e\u043d. <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"sql\">-- Delete time dimension if it already exists. IF Exists(Select Name from sysobjects where name = 'Dim_Time') BEGIN     Drop Table Dim_Time END GO   -- Standard options for creating tables SET ANSI_NULLS ON GO   SET QUOTED_IDENTIFIER ON GO   -- Create your dimension table -- Adjust to your own needs Create Table dbo.Dim_Time (     Dateid int IDENTITY (1,1) PRIMARY KEY CLUSTERED,     Date date,     DateString varchar(10),     Day int,     DayofYear int,     DayofWeek int,     DayofWeekName varchar(10),     Week int,     Month int,     MonthName varchar(10),     Quarter int,     Year int,     IsWeekend bit,     IsLeapYear bit )   -- Declare and set variables for loop Declare @StartDate datetime, @EndDate datetime, @Date datetime   Set @StartDate = '2000\/01\/01' Set @EndDate = '2020\/12\/31' Set @Date = @StartDate   -- Loop through dates WHILE @Date &lt;=@EndDate BEGIN     -- Check for leap year     DECLARE @IsLeapYear BIT     IF ((Year(@Date) % 4 = 0) AND (Year(@Date) % 100 != 0 OR Year(@Date) % 400 = 0))     BEGIN         SELECT @IsLeapYear = 1     END     ELSE     BEGIN         SELECT @IsLeapYear = 0     END       -- Check for weekend     DECLARE @IsWeekend BIT     IF (DATEPART(dw, @Date) = 1 OR DATEPART(dw, @Date) = 7)     BEGIN         SELECT @IsWeekend = 1     END     ELSE     BEGIN         SELECT @IsWeekend = 0     END       -- Insert record in dimension table     INSERT Into Dim_Time     (     [Date],     [DateString],     [Day],     [DayofYear],     [DayofWeek],     [Dayofweekname],     [Week],     [Month],     [MonthName],     [Quarter],     [Year],     [IsWeekend],     [IsLeapYear]     )     Values     (     @Date,     CONVERT(varchar(10), @Date, 105), -- See links for 105 explanation     Day(@Date),     DATEPART(dy, @Date),     DATEPART(dw, @Date),     DATENAME(dw, @Date),     DATEPART(wk, @Date),     DATEPART(mm, @Date),     DATENAME(mm, @Date),     DATENAME(qq, @Date),     Year(@Date),     @IsWeekend,     @IsLeapYear     )       -- Goto next day     Set @Date = @Date + 1 END GO  <\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u041f\u0435\u0440\u0435\u043d\u0435\u0441\u0435\u043c \u043d\u0430 \u0440\u0430\u0431\u043e\u0447\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 <\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/9c3\/c05\/7b6\/9c3c057b65ee49005b4b55ef1e302110.png\" alt=\"image\"\/><\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/13f\/62d\/708\/13f62d708ba74062cdc32f828172968d.png\" alt=\"image\"\/><\/p>\n<p>  \u0411\u0430\u0437\u0443 TEST \u0438 OLE DB \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 localhost.TEST \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u043f\u043e\u043f\u0443\u0442\u043d\u043e.<\/p>\n<p>  \u041a\u0430\u043a \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0431\u0440\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e \u0434\u0430\u0442\u0443 \u0438\u0437 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0435\u0435 \u043d\u0430 WebServiceTask. <\/p>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. <\/p>\n<h4>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435<\/h4>\n<p>  \u041f\u0440\u0430\u0432\u044b\u0439 \u0449\u0435\u043b\u0447\u043e\u043a \u043d\u0430 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u2014 Variables. \u0418\u043b\u0438 \u043c\u0435\u043d\u044e View \u2014 Other Windows \u2014 Variables. \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043d\u043e \u043c\u044b \u0443\u043f\u043e\u043c\u044f\u043d\u0435\u043c \u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0432\u0441\u043a\u043e\u043b\u044c\u0437\u044c, \u0431\u0435\u0437 \u043d\u0435\u0433\u043e SSIS \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0438 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u044b \u0437\u0430\u044f\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e. <br \/>  \u0421\u043e\u0437\u0434\u0438\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e UDate \u0442\u0438\u043f\u0430 System.Object, \u0442.\u043a. \u0431\u0443\u0434\u0435\u043c \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. <br \/>  \u0421\u043e\u0435\u0434\u0438\u043d\u0438\u043c \u0435\u0435 \u0441 \u043d\u0430\u0448\u0438\u043c SQL Task<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/620\/9fd\/680\/6209fd680fc4bd871a592366ee59e5fb.png\" alt=\"image\"\/><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043a SQL-Task Foreach Loop Container. <br \/>  \u042d\u0442\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 (\u0442\u0443\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0441\u0443\u043d\u0443\u0442\u044c \u043b\u044e\u0431\u0443\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439), \u043e\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 foreach \u0440\u0443\u0442\u0438\u043d\u0443. <br \/>  \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u043a\u0443\u0440\u0441\u043e\u0432 \u0432\u0430\u043b\u044e\u0442 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0434\u0430\u0442\u044b \u0438\u0437 \u043d\u0430\u0431\u043e\u0440\u0430 UDate.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u043e\u0442 \u0442\u0430\u043a \u043e\u043d \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/9f1\/5d6\/0af\/9f15d60afbaf3cb3eae6262135949cf8.png\" alt=\"image\"\/><br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/ae0\/419\/916\/ae0419916ea2c6697be1d97fde59bb34.png\" alt=\"image\"\/> <\/div>\n<\/div>\n<p>  \u0421\u043e\u0437\u0434\u0430\u043d\u0430\u044f \u043d\u0430\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f Date \u0442\u0438\u043f\u0430 Date \u2014 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u2014 \u0442\u0430\u043a \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0434\u0438\u043c \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u0430\u0442\u0443. <\/p>\n<p>  \u0412\u043e\u0442 \u0447\u0442\u043e \u043c\u044b \u043f\u043e\u043b\u043e\u0436\u0438\u043c \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/0b7\/e89\/ebe\/0b7e89ebe3bc9d8358b21001770777d8.png\" alt=\"image\"\/><\/p>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0447\u0442\u043e \u0437\u0430 DataFlow \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0437\u0430 \u043d\u0430\u0448\u0438\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c \u2014 \u0442\u0430\u043c \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e. \u0427\u0438\u0442\u0430\u0435\u043c XML \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e XML \u2014 Source, <br \/>  \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043b\u043e\u043d\u043a\u0443 Date \u2014 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443. <br \/>  \u0418 \u0442\u0430\u043a \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0434\u0430\u0442\u044b. <\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/3ad\/016\/02b\/3ad01602b0aff12d2abf846e2d3532de.png\" alt=\"image\"\/><\/p>\n<p>  \u0412 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435 Derived Column \u2014 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0430\u0448\u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e Date \u2014 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0431\u0430\u0437\u0443. <\/p>\n<p>  \u0412\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f <br \/>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/f88\/bc3\/3a3\/f88bc33a3d56e6bd61bfcfa6f70e137a.png\" alt=\"image\"\/>    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/198224\/\"> http:\/\/habrahabr.ru\/post\/198224\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">\n<h4>\u0417\u0430\u043f\u0430\u0441\u0430\u0435\u043c \u0432\u043f\u0440\u043e\u043a<\/h4>\n<p>  \u0418\u043d\u043e\u0433\u0434\u0430 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u044b\u0432\u0430\u044e\u0442 \u043d\u0443\u0436\u043d\u044b \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 SOAP \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442. <\/p>\n<p>  ETL-\u043f\u0440\u043e\u0446\u0435\u0441\u0441 (Extract \u2014 Transform \u2014 Load) \u044d\u0442\u043e \u0442\u0435\u0440\u043c\u0438\u043d \u0438\u0437 Business Intelligence \u0438 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0431\u043e\u0440\u0430 \u0438 \u0442\u0440\u0430\u043d\u0441\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u0434\u0430\u043d\u043d\u044b\u0445).<\/p>\n<p>  SOAP \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u043e\u0431\u043c\u0435\u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u044b\u0435 WSDL \u2014 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u043d\u0430 \u0432 \u043c\u0438\u0440 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0435\u0445 ERP \u0441\u0438\u0441\u0442\u0435\u043c, \u043c\u043d\u043e\u0433\u0438\u0445 \u043e\u043d\u043b\u0430\u0439\u043d \u043f\u043e\u0440\u0442\u0430\u043b\u043e\u0432 \u0438 \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u044b\u0445 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0439. <\/p>\n<p>  \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u044e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e ETL \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u043c\u043e\u0449\u043d\u0435\u0439\u0448\u0438\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 \u2014 MS Integration Services. <\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443. <\/p>\n<h4>\u0417\u0430\u0434\u0430\u0447\u0430<\/h4>\n<p>  \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043a\u0443\u0440\u0441\u0430\u0445 \u0432\u0430\u043b\u044e\u0442 \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a \u0440\u0443\u0431\u043b\u044e \u043d\u0430 \u043a\u0430\u0436\u0434\u0443\u044e \u0434\u0430\u0442\u0443 \u043f\u0440\u043e\u0448\u043b\u043e\u0433\u043e \u0433\u043e\u0434\u0430 \u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438\u0445 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430. \u0426\u0435\u043d\u0442\u0440\u043e\u0431\u0430\u043d\u043a \u0420\u043e\u0441\u0441\u0438\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u2014 \u0432 \u0432\u0438\u0434\u0435 \u0432\u0435\u0431 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u0441 \u043d\u0435\u043f\u043b\u043e\u0445\u0438\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c. <br \/>  \u041f\u043e\u0445\u043e\u0436\u0435 \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435.   <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-198224","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/198224","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=198224"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/198224\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=198224"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=198224"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=198224"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}