{"id":312566,"date":"2020-11-05T03:00:19","date_gmt":"2020-11-05T03:00:19","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=312566"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=312566","title":{"rendered":"\u0412\u0435\u0434\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0411\u0414. \u0428\u0430\u0431\u043b\u043e\u043d\u044b \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f\/\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 MSSQL"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/rg\/hj\/cy\/rghjcy4i90vqvzfbxq3l1mahpik.jpeg\">  <\/p>\n<p>\u041f\u0440\u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 MSSQL \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0411\u0414: \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u044b \u0438 \u0442.\u0434.<br \/>  \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0448\u0430\u0431\u043b\u043e\u043d\u044b SQL \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u0443\u0442, \u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0438\u0440\u0443\u044e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 T-SQL.<br \/>  \u041a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e, \u043e\u043f\u0438\u0448\u0443 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u044f \u0432\u0435\u0434\u0443 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0411\u0414 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0439.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 SQL \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432<\/h2>\n<p>  <\/p>\n<p>1) \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u043d\u0435 \u0432\u044b\u0434\u0430\u0432\u0430\u044f \u043e\u0448\u0438\u0431\u043e\u043a<br \/>  2) \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b PRINT \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043e\u0442\u043b\u0430\u0434\u043a\u0438<br \/>  3) \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0434\u043e\u043b\u0436\u043d\u043e \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043e\u0434\u0438\u043d \u043e\u0431\u0449\u0438\u0439 \u0444\u0430\u0439\u043b<br \/>  4) \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0443\u0442\u0438\u043b\u0438\u0442 (sqlcmd, bcp)<br \/>  5) \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0411\u0414 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c SQL \u0444\u0430\u0439\u043b\u043e\u043c<br \/>  6) SQL \u0441\u043a\u0440\u0438\u043f\u0442\u044b (\u0444\u0430\u0439\u043b\u044b) \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442\u0441\u044f BAT \u0444\u0430\u0439\u043b\u043e\u043c \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u0411\u0414<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u044f\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u044b SQL \u0444\u0430\u0439\u043b\u043e\u0432 \u0438 BAT \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u044d\u0442\u0438\u0445 SQL \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<\/p>\n<p>  <\/p>\n<h2>\u0428\u0430\u0431\u043b\u043e\u043d\u044b T-SQL<\/h2>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435\/\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"sql\">--USE [DatabaseName] --GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO --\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043d\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0411\u0414 if objectproperty (object_id ('dbo.TableName'), N'IsUserTable') IS NULL begin     print N'\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b - dbo.TableName'     create table dbo.TableName     (         TableNameId uniqueidentifier default newid() not null,         FieldName1 uniqueidentifier not null,         FieldName2 varchar(20) not null,         CONSTRAINT PK_TableName PRIMARY KEY (TableNameId),         CONSTRAINT FK_TableName_FieldName1 FOREIGN KEY (FieldName1)                 REFERENCES dbo.ReferenceTableName (RefFieldName)                 ON UPDATE CASCADE,         CONSTRAINT UQ_TableName_FieldName1_FieldName2 UNIQUE (FieldName1, FieldName2)     ); end GO  -- \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u0435 if not exists (         select *         from INFORMATION_SCHEMA.COLUMNS         where TABLE_SCHEMA = 'dbo'           and TABLE_NAME = 'TableName'           and COLUMN_NAME = 'FieldName'         ) begin     alter table dbo.TableName add FieldName varchar(500)     print N'\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e \u043f\u043e\u043b\u0435 FieldName \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 dbo.TableName' end  -- \u0421\u043e\u0437\u0434\u0430\u0442\u044c FOREIGN KEY, \u0435\u0441\u043b\u0438 \u0435\u0433\u043e \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 if not exists (select * from sys.foreign_keys where object_id = OBJECT_ID(N'dbo.FK_TableName_FieldName1') AND parent_object_id = OBJECT_ID(N'dbo.TableName')) ALTER TABLE dbo.TableName WITH CHECK ADD CONSTRAINT FK_TableName_FieldName1 FOREIGN KEY(FieldName1) REFERENCES dbo.ReferenceTableName (RefFieldName) GO IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'dbo.FK_TableName_FieldName1') AND parent_object_id = OBJECT_ID(N'dbo.TableName')) ALTER TABLE dbo.TableName CHECK CONSTRAINT FK_TableName_FieldName1 GO  -- \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430, \u0435\u0441\u043b\u0438 \u043e\u043d \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 if not exists (select * from information_schema.key_column_usage where CONSTRAINT_NAME='UQ_TableName_FieldName1_FieldName2') begin     ALTER TABLE dbo.TableName ADD CONSTRAINT UQ_TableName_FieldName1_FieldName2 UNIQUE (FieldName1, FieldName2) end  -- \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 DEFAULT \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f, \u0435\u0441\u043b\u0438 \u043e\u043d \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 if not exists (select * from sysconstraints where id = OBJECT_ID('dbo.TableName') AND COL_NAME(id,colid) = 'FieldName2' AND OBJECTPROPERTY(constid, 'IsDefaultCnst') = 1) begin     ALTER TABLE dbo.TableName ADD CONSTRAINT DF_TableName_FieldName2 DEFAULT ('DefaultValue') FOR FieldName2 end  declare @SchemaName varchar(128) = 'dbo' declare @TableName varchar(128) = 'TableName'  -- \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b IF NOT EXISTS (SELECT * FROM fn_listextendedproperty('MS_Description', 'SCHEMA', @SchemaName, 'TABLE', @TableName, default, default))     EXECUTE sp_addextendedproperty         N'MS_Description', N'\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b',         N'SCHEMA', @SchemaName,         N'TABLE', @TableName  -- \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044f, \u0435\u0441\u043b\u0438 \u0435\u0433\u043e \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 IF NOT EXISTS (SELECT * FROM fn_listextendedproperty ('MS_Description', 'schema', @SchemaName, 'table', @TableName, 'column', 'FieldName1'))     EXECUTE sp_addextendedproperty         N'MS_Description', N'\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u044f FieldName1',         N'SCHEMA', @SchemaName,         N'TABLE', @TableName,         N'COLUMN', N'FieldName1' GO<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435\/\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"sql\">--USE [DatabaseName] --GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO --\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043d\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u0411\u0414 if objectproperty (object_id ('dbo.vw_ViewName'), N'IsView') is null BEGIN     PRINT 'CREATE VIEW - '+db_name()+'.dbo.vw_ViewName'     EXECUTE('CREATE VIEW dbo.vw_ViewName AS SELECT 1\/0 as ColumnName'); END GO PRINT 'ALTER VIEW - '+db_name()+'.dbo.vw_ViewName' GO alter view dbo.vw_ViewName as select     FieldName1, FieldName2 from dbo.TableName<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435\/\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"sql\">--USE [DatabaseName] --GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO if objectproperty (object_id ('dbo.usp_StoredProcedureName'), N'IsProcedure') is null BEGIN -- If procedure exists, we exclude script execution.     PRINT 'CREATE PROCEDURE - '+db_name()+'.dbo.usp_StoredProcedureName'     EXECUTE('CREATE PROCEDURE dbo.usp_StoredProcedureName as select 1\/0'); END ELSE     PRINT 'ALTER PROCEDURE - '+db_name()+'.dbo.usp_StoredProcedureName' GO alter procedure dbo.usp_StoredProcedureName as select null<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435\/\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"sql\">--USE [DatabaseName] --GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO --\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043d\u0430 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0430 \u0432 \u0411\u0414 if objectproperty (object_id ('dbo.TriggerName'), N'IsTrigger') is null BEGIN     PRINT 'CREATE TRIGGER - '+db_name()+'.dbo.TriggerName'     EXECUTE('CREATE TRIGGER dbo.TriggerName on dbo.TableName for insert as print 0'); END GO PRINT 'ALTER TRIGGER - '+db_name()+'.dbo.TriggerName' GO alter trigger dbo.TriggerName on dbo.TableName for insert, update, delete as if (exists(SELECT 1 from inserted) and exists (SELECT 1 from deleted)) -- \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 UPDATE begin   if update(FieldName)     begin       update dbo.TableName       set FieldName = FieldValue       where SearchFieldName in       (         select FieldValue from inserted         union         select FieldValue from deleted       )     end end else if (exists(SELECT 1 from inserted) and not exists (SELECT 1 from deleted)) -- \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 INSERT begin   \/* \u0412\u0430\u0448 \u043a\u043e\u0434 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 *\/ end else if (not exists(SELECT 1 from inserted) and exists (SELECT 1 from deleted)) -- \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 DELETE begin   \/* \u0412\u0430\u0448 \u043a\u043e\u0434 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 *\/ end;<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435\/\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"sql\">--USE [DatabaseName] --GO \/* DROP PROCEDURE dbo.ProcedureName DROP TYPE dbo.CustomUserType *\/ IF TYPE_ID(N'dbo.CustomUserType') IS NULL  BEGIN     PRINT N'\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u0430 - dbo.CustomUserType'     --\u0415\u0441\u043b\u0438 \u0442\u0438\u043f \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0435\u0433\u043e.     CREATE TYPE dbo.CustomUserType AS TABLE     (         FieldId TYPE,         PRIMARY KEY (FieldId)     ) END GO<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435\/\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u043a\u0430\u043b\u044f\u0440\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"sql\">--USE [DatabaseName] --GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO if objectproperty (object_id ('dbo.ufn_FunctionName'), N'IsScalarFunction') is null BEGIN -- If procedure exists, we exclude script execution.     PRINT 'CREATE FUNCTION - '+db_name()+'.dbo.ufn_FunctionName'     EXECUTE('CREATE FUNCTION dbo.ufn_FunctionName() returns int begin return 0 end'); END ELSE     PRINT 'ALTER FUNCTION - '+db_name()+'.dbo.ufn_FunctionName' GO alter function dbo.ufn_FunctionName () returns varchar(100) begin     return null; end GO<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435\/\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"sql\">--USE [DatabaseName] --GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO if objectproperty (object_id ('dbo.ufn_TableFunctionName'), N'IsTableFunction') is null BEGIN -- If procedure exists, we exclude script execution.     PRINT 'CREATE FUNCTION - '+db_name()+'.dbo.ufn_TableFunctionName'     EXECUTE('CREATE FUNCTION dbo.ufn_TableFunctionName() returns table as return (select null as c)'); END ELSE     PRINT 'ALTER FUNCTION - '+db_name()+'.dbo.ufn_TableFunctionName' GO ALTER function dbo.ufn_TableFunctionName() returns table     as return (     select 1 as Field1, 2 as Field2 )<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435\/\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 XSD-\u0441\u0445\u0435\u043c (XmlSchemaCollection)<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"sql\">--USE [DatabaseName] --GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO if exists (select * from sys.xml_schema_collections where [schema_id] = schema_id('dbo') and [name] = 'SdmxXsd') begin     drop XML SCHEMA COLLECTION dbo.SdmxXsd     print '\u0423\u0434\u0430\u043b\u0435\u043d\u0430 XSD \u0441\u0445\u0435\u043c\u0430 - dbo.SdmxXsd' end  --\u0421\u043e\u0437\u0434\u0430\u0442\u044c XSD \u0441\u0445\u0435\u043c\u0443, \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u0411\u0414 if not exists (select * from sys.xml_schema_collections where [schema_id] = schema_id('dbo') and [name] = 'SdmxXsd') begin     CREATE XML SCHEMA COLLECTION dbo.SdmxXsd as N'&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt; &lt;xs:schema attributeFormDefault=&quot;unqualified&quot; elementFormDefault=&quot;qualified&quot; xmlns:xs=&quot;http:\/\/www.w3.org\/2001\/XMLSchema&quot;&gt;   &lt;xs:element name=&quot;Ref&quot;&gt;     &lt;xs:complexType&gt;       &lt;xs:attribute name=&quot;agencyID&quot; type=&quot;xs:string&quot; use=&quot;required&quot; \/&gt;       &lt;xs:attribute name=&quot;id&quot; type=&quot;xs:unsignedInt&quot; use=&quot;required&quot; \/&gt;       &lt;xs:attribute name=&quot;version&quot; type=&quot;xs:decimal&quot; use=&quot;required&quot; \/&gt;     &lt;\/xs:complexType&gt;   &lt;\/xs:element&gt; &lt;\/xs:schema&gt;'      ALTER XML SCHEMA COLLECTION dbo.SdmxXsd add N'&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt; &lt;xs:schema xmlns:tns=&quot;http:\/\/www.sdmx.org\/resources\/sdmxml\/schemas\/v2_1\/common&quot; attributeFormDefault=&quot;unqualified&quot; elementFormDefault=&quot;qualified&quot; targetNamespace=&quot;http:\/\/www.sdmx.org\/resources\/sdmxml\/schemas\/v2_1\/common&quot; xmlns:xs=&quot;http:\/\/www.w3.org\/2001\/XMLSchema&quot;&gt;   &lt;xs:import \/&gt;   &lt;xs:element name=&quot;Structure&quot;&gt;     &lt;xs:complexType&gt;       &lt;xs:sequence&gt;         &lt;xs:element ref=&quot;Ref&quot; \/&gt;       &lt;\/xs:sequence&gt;     &lt;\/xs:complexType&gt;   &lt;\/xs:element&gt; &lt;\/xs:schema&gt;'      ALTER XML SCHEMA COLLECTION dbo.SdmxXsd add N'&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt; &lt;xs:schema xmlns:tns=&quot;http:\/\/www.sdmx.org\/resources\/sdmxml\/schemas\/v2_1\/data\/generic&quot; attributeFormDefault=&quot;unqualified&quot; elementFormDefault=&quot;qualified&quot; targetNamespace=&quot;http:\/\/www.sdmx.org\/resources\/sdmxml\/schemas\/v2_1\/data\/generic&quot; xmlns:xs=&quot;http:\/\/www.w3.org\/2001\/XMLSchema&quot;&gt;   &lt;xs:element name=&quot;Series&quot;&gt;     &lt;xs:complexType&gt;       &lt;xs:sequence&gt;         &lt;xs:element name=&quot;SeriesKey&quot;&gt;           &lt;xs:complexType&gt;             &lt;xs:sequence&gt;               &lt;xs:element maxOccurs=&quot;unbounded&quot; name=&quot;Value&quot;&gt;                 &lt;xs:complexType&gt;                   &lt;xs:attribute name=&quot;id&quot; type=&quot;xs:string&quot; use=&quot;required&quot; \/&gt;                   &lt;xs:attribute name=&quot;value&quot; type=&quot;xs:string&quot; use=&quot;required&quot; \/&gt;                 &lt;\/xs:complexType&gt;               &lt;\/xs:element&gt;             &lt;\/xs:sequence&gt;           &lt;\/xs:complexType&gt;         &lt;\/xs:element&gt;         &lt;xs:element name=&quot;Attributes&quot;&gt;           &lt;xs:complexType&gt;             &lt;xs:sequence&gt;               &lt;xs:element maxOccurs=&quot;unbounded&quot; name=&quot;Value&quot;&gt;                 &lt;xs:complexType&gt;                   &lt;xs:attribute name=&quot;id&quot; type=&quot;xs:string&quot; use=&quot;required&quot; \/&gt;                   &lt;xs:attribute name=&quot;value&quot; type=&quot;xs:string&quot; use=&quot;required&quot; \/&gt;                 &lt;\/xs:complexType&gt;               &lt;\/xs:element&gt;             &lt;\/xs:sequence&gt;           &lt;\/xs:complexType&gt;         &lt;\/xs:element&gt;         &lt;xs:element name=&quot;Obs&quot;&gt;           &lt;xs:complexType&gt;             &lt;xs:sequence&gt;               &lt;xs:element name=&quot;ObsDimension&quot;&gt;                 &lt;xs:complexType&gt;                   &lt;xs:attribute name=&quot;value&quot; type=&quot;xs:string&quot; use=&quot;required&quot; \/&gt;                 &lt;\/xs:complexType&gt;               &lt;\/xs:element&gt;               &lt;xs:element name=&quot;ObsValue&quot;&gt;                 &lt;xs:complexType&gt;                   &lt;xs:attribute name=&quot;value&quot; type=&quot;xs:decimal&quot; use=&quot;required&quot; \/&gt;                 &lt;\/xs:complexType&gt;               &lt;\/xs:element&gt;             &lt;\/xs:sequence&gt;           &lt;\/xs:complexType&gt;         &lt;\/xs:element&gt;       &lt;\/xs:sequence&gt;     &lt;\/xs:complexType&gt;   &lt;\/xs:element&gt; &lt;\/xs:schema&gt;'      ALTER XML SCHEMA COLLECTION dbo.SdmxXsd add N'&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt; &lt;xs:schema xmlns:message=&quot;http:\/\/www.sdmx.org\/resources\/sdmxml\/schemas\/v2_1\/message&quot; xmlns:common=&quot;http:\/\/www.sdmx.org\/resources\/sdmxml\/schemas\/v2_1\/common&quot; xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot; xmlns:generic=&quot;http:\/\/www.sdmx.org\/resources\/sdmxml\/schemas\/v2_1\/data\/generic&quot; attributeFormDefault=&quot;unqualified&quot; elementFormDefault=&quot;qualified&quot; targetNamespace=&quot;http:\/\/www.sdmx.org\/resources\/sdmxml\/schemas\/v2_1\/message&quot; xmlns:xs=&quot;http:\/\/www.w3.org\/2001\/XMLSchema&quot;&gt;   &lt;xs:import namespace=&quot;http:\/\/www.sdmx.org\/resources\/sdmxml\/schemas\/v2_1\/common&quot; \/&gt;   &lt;xs:import namespace=&quot;http:\/\/www.sdmx.org\/resources\/sdmxml\/schemas\/v2_1\/data\/generic&quot; \/&gt;   &lt;xs:element name=&quot;GenericData&quot;&gt;     &lt;xs:complexType&gt;       &lt;xs:sequence&gt;         &lt;xs:element name=&quot;Header&quot;&gt;           &lt;xs:complexType&gt;             &lt;xs:sequence&gt;               &lt;xs:element name=&quot;ID&quot; type=&quot;xs:string&quot; \/&gt;               &lt;xs:element name=&quot;Test&quot; type=&quot;xs:boolean&quot; \/&gt;               &lt;xs:element name=&quot;Truncated&quot; type=&quot;xs:boolean&quot; \/&gt;               &lt;xs:element name=&quot;Prepared&quot; type=&quot;xs:dateTime&quot; \/&gt;               &lt;xs:element name=&quot;Sender&quot;&gt;                 &lt;xs:complexType&gt;                   &lt;xs:attribute name=&quot;id&quot; type=&quot;xs:string&quot; use=&quot;required&quot; \/&gt;                 &lt;\/xs:complexType&gt;               &lt;\/xs:element&gt;               &lt;xs:element name=&quot;Structure&quot;&gt;                 &lt;xs:complexType&gt;                   &lt;xs:sequence&gt;                     &lt;xs:element ref=&quot;common:Structure&quot; \/&gt;                   &lt;\/xs:sequence&gt;                   &lt;xs:attribute name=&quot;structureID&quot; type=&quot;xs:string&quot; use=&quot;required&quot; \/&gt;                   &lt;xs:attribute name=&quot;dimensionAtObservation&quot; type=&quot;xs:string&quot; use=&quot;required&quot; \/&gt;                 &lt;\/xs:complexType&gt;               &lt;\/xs:element&gt;             &lt;\/xs:sequence&gt;           &lt;\/xs:complexType&gt;         &lt;\/xs:element&gt;         &lt;xs:element name=&quot;DataSet&quot;&gt;           &lt;xs:complexType&gt;             &lt;xs:sequence&gt;               &lt;xs:element maxOccurs=&quot;unbounded&quot; ref=&quot;generic:Series&quot; \/&gt;             &lt;\/xs:sequence&gt;             &lt;xs:attribute name=&quot;structureRef&quot; type=&quot;xs:string&quot; use=&quot;required&quot; \/&gt;           &lt;\/xs:complexType&gt;         &lt;\/xs:element&gt;       &lt;\/xs:sequence&gt;     &lt;\/xs:complexType&gt;   &lt;\/xs:element&gt; &lt;\/xs:schema&gt;'      print '\u0421\u043e\u0437\u0434\u0430\u043d\u0430 XSD \u0441\u0445\u0435\u043c\u0430 - dbo.SdmxXsd' end go<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<h2>\u0412\u0435\u0434\u0435\u043d\u0438\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/h2>\n<p>  <\/p>\n<p>1) \u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043f\u0430\u043f\u043e\u043a, \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u043f\u043e \u0442\u0438\u043f\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: Tables, Views, Triggers \u0438 \u0442.\u0434.)<br \/>  2) \u041a\u0430\u0436\u0434\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0411\u0414 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c SQL \u0444\u0430\u0439\u043b\u0435 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0439.<br \/>  3) \u0415\u0441\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u0430\u0441\u0430\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u0442\u043e \u0442\u0430\u043a\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u0435\u0434\u0443\u0442\u0441\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 &quot;CommonChanges (version 000).sql&quot;, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0411\u0414<br \/>  4) \u0414\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e BAT \u0444\u0430\u0439\u043b\u0430.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 BAT \u0444\u0430\u0439\u043b\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">:: \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435: \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0411\u0414 Microsoft SQL Server :: :: \u0412\u041d\u0418\u041c\u0410\u041d\u0418\u0415: \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 &quot;1. \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432&quot; \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u0440\u0443\u0441\u0441\u043a\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b, \u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 ::chcp 1251 :: :: 1. \u041e\u041f\u0418\u0421\u0410\u041d\u0418\u0415 \u041f\u0410\u0420\u0410\u041c\u0415\u0422\u0420\u041e\u0412 :: :: \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0431\u0449\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 (\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u0411\u0414 \u0438 \u0434\u0440.) call Settings.bat :: :: \u041b\u043e\u0433-\u0444\u0430\u0439\u043b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 (\u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u0432\u044b\u0437\u043e\u0432\u043e\u043c sqlcmd) set LogFileName=&quot;%LogDir%\\update_0001_%NowDateTime%_tmp.log&quot; :: :: \u041f\u043e\u043b\u043d\u044b\u0439 \u043b\u043e\u0433-\u0444\u0430\u0439\u043b \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0411\u0414 set FullLogFileName=&quot;%LogDir%\\update_0001_%NowDateTime%.log&quot; :: :: \u041b\u043e\u0433 \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f set LogCmdFileName=&quot;%LogDir%\\update_0001_%NowDateTime%_cmd.log&quot; :: :: 2. \u0412\u042b\u041f\u041e\u041b\u041d\u0415\u041d\u0418\u0415 SQL-\u0417\u0410\u041f\u0420\u041e\u0421\u041e\u0412 :: set SqlFileName=&quot;..\\CommonChanges (version 001).sql&quot; @If Exist %SqlFileName% ( %sqlcmd% -S %ServerName% -U %UserName% -P %Password% -d %DatabaseName% -i %SqlFileName% -o %LogFileName% -b type %LogFileName% &gt;&gt; %FullLogFileName% ) ElSE ( echo \u041d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d \u0444\u0430\u0439\u043b \u0441\u043a\u0440\u0438\u043f\u0442\u0430 %SqlFileName% &gt;&gt; %LogCmdFileName% ) :: set SqlFileName=&quot;..\\AlterObjects\\StoredProcedures\\dbo.SP.sql&quot; @If Exist %SqlFileName% ( %sqlcmd% -S %ServerName% -U %UserName% -P %Password% -d %DatabaseName% -i %SqlFileName% -o %LogFileName% -b type %LogFileName% &gt;&gt; %FullLogFileName% ) ElSE ( echo \u041d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d \u0444\u0430\u0439\u043b \u0441\u043a\u0440\u0438\u043f\u0442\u0430 %SqlFileName% &gt;&gt; %LogCmdFileName% ) :: set SqlFileName=&quot;..\\UpdateVersion.sql&quot; @If Exist %SqlFileName% ( %sqlcmd% -S %ServerName% -U %UserName% -P %Password% -d %DatabaseName% -i %SqlFileName% -o %LogFileName% -b type %LogFileName% &gt;&gt; %FullLogFileName% ) ElSE ( echo \u041d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d \u0444\u0430\u0439\u043b \u0441\u043a\u0440\u0438\u043f\u0442\u0430 %SqlFileName% &gt;&gt; %LogCmdFileName% ) :: :: \u0412\u044b\u0432\u0435\u0441\u0442\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043b\u043e\u0433\u0430 \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432 \u043e\u0431\u0449\u0438\u0439 \u043b\u043e\u0433, \u0435\u0441\u043b\u0438 \u043e\u043d \u0431\u044b\u043b \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d @If Exist %LogCmdFileName% ( echo ----\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u044b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0444\u0430\u0439\u043b\u044b \u043e\u0436\u0438\u0434\u0430\u044e\u0449\u0438\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f:---- &gt;&gt; %FullLogFileName% type %LogCmdFileName% &gt;&gt; %FullLogFileName% :: \u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043b\u043e\u0433 \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f del %LogCmdFileName% ) :: \u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u044b\u0439 \u043b\u043e\u0433 (\u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0439\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u0432\u044b\u0437\u043e\u0432\u0435 sqlcmd) del %LogFileName% :: :: \u0412\u044b\u0432\u0435\u0441\u0442\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430-\u043b\u043e\u0433\u0430 \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 type %FullLogFileName% pause<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0424\u0430\u0439\u043b Settings.bat<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">:: \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u0411\u0414 :: :: \u0412\u041d\u0418\u041c\u0410\u041d\u0418\u0415: \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 &quot;1. \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432&quot; \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0441\u044f \u0440\u0443\u0441\u0441\u043a\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b, \u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 ::chcp 1251 :: :: 1. \u041e\u041f\u0418\u0421\u0410\u041d\u0418\u0415 \u041f\u0410\u0420\u0410\u041c\u0415\u0422\u0420\u041e\u0412 :: :: \u041f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443 sqlcmd.exe \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u0434\u0438\u0441\u043a\u0435 set sqlcmd=&quot;sqlcmd.exe&quot; :: :: \u041f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443 bcp.exe \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u0434\u0438\u0441\u043a\u0435 set bcp=&quot;bcp.exe&quot; :: :: \u0418\u043c\u044f SQL-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 (\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440) set ServerName=&quot;(local)\\InstanceName&quot; :: :: \u0418\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f set UserName=&quot;sa&quot; :: :: \u041f\u0430\u0440\u043e\u043b\u044c set Password=&quot;my_password&quot; :: :: \u0418\u043c\u044f \u0411\u0414 set DatabaseName=my_db :: :: \u041a\u0430\u0442\u0430\u043b\u043e\u0433 \u043b\u043e\u0433\u043e\u0432 set LogDir=.\\log :: :: \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u044f\u0437\u044b\u0447\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Windows. \u0422\u0435\u043a\u0443\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 YYYYMMDD_HHMMSS (\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0438\u043c\u0435\u043d\u0438 \u0444\u0430\u0439\u043b\u0430 \u043b\u043e\u0433\u0430) set NowDateTime=%date:~6%%date:~3,2%%date:~0,2%_%TIME:~0,2%%TIME:~3,2%%TIME:~6,2% :: \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 Windows. \u0422\u0435\u043a\u0443\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 YYYYMMDD_HHMMSS (\u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0438\u043c\u0435\u043d\u0438 \u0444\u0430\u0439\u043b\u0430 \u043b\u043e\u0433\u0430) ::set NowDateTime=%date:~10,4%%date:~4,2%%date:~7,2%_%TIME:~0,2%%TIME:~3,2%%TIME:~6,2% :: :: 2. \u0421\u041e\u0417\u0414\u0410\u041d\u0418\u0415 \u041a\u0410\u0422\u0410\u041b\u041e\u0413\u0410 \u0414\u041b\u042f \u0425\u0420\u0410\u041d\u0415\u041d\u0418\u042f \u041b\u041e\u0413\u041e\u0412 md %LogDir%<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<h3>\u0414\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432\u0430<\/h3>\n<p>  <\/p>\n<p>1) \u0423\u0434\u043e\u0431\u043d\u043e \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0411\u0414<br \/>  2) \u041d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f SQL \u0444\u0430\u0439\u043b\u043e\u0432<br \/>  3) \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u0432\u0441\u0435\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 MSSQL \u0438 Windows<br \/>  4) \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u0411\u0414, \u0438\u043c\u0435\u043d\u0430 \u0411\u0414 \u0438 \u0434\u0440. \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 &quot;Settings.bat&quot;, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043b\u0435\u0433\u043a\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c<\/p>\n<p>  <\/p>\n<h3>\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438<\/h3>\n<p>  <\/p>\n<p>1) \u041d\u0435 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u043e\u0431\u0449\u0438\u0439 \u043e\u0442\u043a\u0430\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u0435\u0441\u043b\u0438 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0441\u043a\u0440\u0438\u043f\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439<br \/>  2) \u0415\u0441\u043b\u0438 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0411\u0414, \u0442\u043e \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0443 \u0432\u0435\u0441\u044c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439, \u043d\u0443\u0436\u043d\u043e \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b (\u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0432 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435) \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433<\/p>\n<p>  <\/p>\n<h2>\u0412\u044b\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0411\u0414<\/h2>\n<p>  <\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0411\u0414, \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u043e\u0434\u0438\u043d \u043e\u0431\u044a\u0435\u043a\u0442 = \u043e\u0434\u0438\u043d \u0444\u0430\u0439\u043b, \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e SSMS, \u043d\u043e \u0432 \u0441\u043a\u043e\u0440\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0431\u0443\u0434\u0435\u0442 \u0432 \u043c\u043e\u0435\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435 ImportExportDataSql, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0432\u0441\u0435\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0411\u0414.<\/p>\n<p>  <\/p>\n<h2>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e ImportExportDataSql<\/h2>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 <a href=\"https:\/\/vk.com\/import_export_data_sql\" rel=\"nofollow\">ImportExportDataSql<\/a> \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0435, \u0431\u0435\u0437 \u0440\u0435\u043a\u043b\u0430\u043c\u044b, \u043e\u043f\u043e\u0432\u0435\u0449\u0430\u0435\u0442 \u043e \u043d\u043e\u0432\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445, \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 <a href=\"https:\/\/yadi.sk\/d\/LJib2MpVEDNn3g\" rel=\"nofollow\">\u0441\u043a\u0430\u0447\u0430\u0442\u044c<\/a> \u0435\u0433\u043e \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445.<\/p>\n<p>  <\/p>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e ImportExportDataSql \u0412\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0431\u044b\u0441\u0442\u0440\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c CSV \u0444\u0430\u0439\u043b\u044b \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043c\u0430 (\u0431\u043e\u043b\u0435\u0435 1\u0413\u0431) \u0432 SQL Server<\/li>\n<li>\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c Excel \u0444\u0430\u0439\u043b\u044b \u0438 CSV \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u043e\u043b\u0435\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u0441\u0442\u0440\u043e\u043a (\u0443\u0434\u043e\u0431\u043d\u043e \u043f\u0440\u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0435)<\/li>\n<li>\u0432\u044b\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0432\u044b\u0431\u043e\u0440\u043e\u0447\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0411\u0414, \u0432 SQL \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0438 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u044d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u0411\u0414 (\u0442.\u0435. \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445)<\/li>\n<li>\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0436\u043e\u0431\u044b \u0441 \u043e\u0434\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u043d\u0430 \u0434\u0440\u0443\u0433\u0443\u044e\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/lr\/sz\/fh\/lrszfhtr-hng-a2qcgu7ouydkng.png\" alt=\"image\"><\/li>\n<li> \u0432\u044b\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0411\u0414.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0413\u043b\u0430\u0432\u043d\u043e\u0439 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c\u044e ImportExportDataSql, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e SELECT \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0432\u044b\u0433\u0440\u0443\u0436\u0430\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0432\u0438\u0434\u0435 SQL \u0432 \u043e\u0434\u0438\u043d \u0444\u0430\u0439\u043b.<\/p>\n<p>  <\/p>\n<p><a href=\"https:\/\/vk.com\/import_export_data_sql\" rel=\"nofollow\">\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0439\u0442\u0435\u0441\u044c \u0432 \u0433\u0440\u0443\u043f\u043f\u0443 VK<\/a>, \u043f\u0438\u0448\u0438\u0442\u0435 \u0441\u0432\u043e\u0438 \u043f\u043e\u0436\u0435\u043b\u0430\u043d\u0438\u044f, \u0431\u0443\u0434\u0443 \u0440\u0430\u0434 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u0434 \u0412\u0430\u0448\u0438 \u043d\u0443\u0436\u0434\u044b.<\/p>\n<p>  <\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u0420\u0430\u0434 \u0431\u044b\u043b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0441\u0432\u043e\u0435\u0433\u043e \u043e\u043f\u044b\u0442\u0430. \u0414\u0430\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u043c\u0435\u043d\u044f \u0432\u043f\u043e\u043b\u043d\u0435 \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u043c \u043d\u0430\u0432\u0435\u0441\u0442\u0438 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432 \u0431\u0430\u0437\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<\/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=\"https:\/\/habr.com\/ru\/post\/491048\/\"> https:\/\/habr.com\/ru\/post\/491048\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/rg\/hj\/cy\/rghjcy4i90vqvzfbxq3l1mahpik.jpeg\">  <\/p>\n<p>\u041f\u0440\u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 MSSQL \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0411\u0414: \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u044b \u0438 \u0442.\u0434.<br \/>  \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0448\u0430\u0431\u043b\u043e\u043d\u044b SQL \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u0443\u0442, \u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0438\u0440\u0443\u044e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 T-SQL.<br \/>  \u041a\u0440\u043e\u043c\u0435 \u044d\u0442\u043e\u0433\u043e, \u043e\u043f\u0438\u0448\u0443 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u044f \u0432\u0435\u0434\u0443 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0411\u0414 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0439.<\/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-312566","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/312566","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=312566"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/312566\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=312566"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=312566"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=312566"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}