2013-07-18 3 views
0

배치 명령을 사용하여 SQl 파일을 생성했습니다. 일괄 처리는 디렉터리 아래의 모든 파일 SQl을 배포 용 단일 파일로 대조합니다. 개별 조각 배치 파일에서 잘 작동하지만, 그것은 때문에 파일의 주석 부분이다 "Incorrect syntax near ''.".SQl 파일 및 설명

을 말한다 오류를 제공하지만 내가 코멘트 섹션

코드에서 오류의 원인을 이해하지 못하는 스 니펫은 아래에 있습니다.

  /* 
     ----------------------------------------------------------------------- 
    <copyright file="tblMPI_Configuration.sql" company=""> 

    </copyright> 
    ----------------------------------------------------------------------- 

    Author: 


    Modification Log: 
     $Id: tblMPI_Configuration.sql 22746 2013-06-19 13:20:46Z xxxxxxx $ 

    Description: 
     This table holds the MPI Config Information 
     */ 
    IF EXISTS (SELECT * FROM sysobjects WHERE type = 'U' AND name = 'MPI_Configuration') 
     BEGIN 
      DROP Table MPI_Configuration 
     END 
    GO 


    CREATE TABLE [dbo].[MPI_Configuration](
     [ID] [int] IDENTITY(1,1) NOT NULL, 
     [SourceType] [varchar](3) NULL, 
     [Item] [varchar](50) NOT NULL, 
     [Value] [varchar](50) NULL, 
    CONSTRAINT [PK_MPI_Configuration] PRIMARY KEY CLUSTERED 
    (
     [ID] ASC 
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] 
    ) ON [PRIMARY] 

    GO 


    /* 
    ----------------------------------------------------------------------- 
    <copyright file="tblMPI_LKUP_MatchingStatus.sql" company=""> 

    </copyright> 
    ----------------------------------------------------------------------- 

    Author: 


    Modification Log: 
     $Id: tblMPI_LKUP_MatchingStatus.sql 22746 2013-06-19 13:20:46Z xxxxxxx $ 

    Description: 
     This table holds the MPI matching status 
     */ 
    IF EXISTS (SELECT * FROM sysobjects WHERE type = 'U' AND name = 'MPI_LKUP_MatchingStatus') 
     BEGIN 
      DROP Table MPI_LKUP_MatchingStatus 
     END 
    GO 

    CREATE TABLE [dbo].[MPI_LKUP_MatchingStatus](
     [MPI_StatusCode] [int] NOT NULL, 
     [MPI_StatusMessage] [varchar](100) NULL, 
    CONSTRAINT [PK_MPI_LKUP_MatchingStatus] PRIMARY KEY CLUSTERED 
    (
     [MPI_StatusCode] ASC 
    )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] 
    ) ON [PRIMARY] 

    GO 

답변

1

배치 파일은 어떻게 이러한 파일을 병합합니까? 두 번째 주석 앞에 <feff>이 있습니다. http://en.wikipedia.org/wiki/Byte_order_mark.

<feff>/* <--------------------------------------------------------- Here 
    ----------------------------------------------------------------------- 
    <copyright file="tblMPI_LKUP_MatchingStatus.sql" company=""> 

    </copyright> 
    ----------------------------------------------------------------------- 

    Author: 


    Modification Log: 
     $Id: tblMPI_LKUP_MatchingStatus.sql 22746 2013-06-19 13:20:46Z xxxxxxx $ 

    Description: 
     This table holds the MPI matching status 
     */ 

그리고 여기에 구글이 나에게 보여 것입니다 : http://connect.microsoft.com/SQLServer/feedback/details/789853/sql-text-containing-a-byte-order-mark-fails-to-execute.

수정 링크는 다음 링크를 참조하십시오. http://social.msdn.microsoft.com/Forums/en-US/01185066-a387-4c49-8087-e472182935ef/urgetnt-byte-order-mark-error-error-reading-data-from-sql-server-using-custom-pipeline