SQL 2012 warning: "inconsistent line endings"

cmorris73cmorris73 Posts: 3
edited December 5, 2013 7:13PM in SQL Compare Previous Versions
I am using SQL Compare 10 to generate a DB Diff script to send out to clients for a database upgrade. In SQL 2012 I am receiving a warning when opening this Diff script saying "Inconsistent Line Endings". I know you can click Yes to continue opening the file, but I am getting questions about a fix from our QA department so clients will not receive this message.

Comments

  • Eddie DEddie D Posts: 1,803 Rose Gold 5
    Thank you for your forum post and sorry that you have encountered a problem.

    A support ticket has been created for you, the call reference is 8545 and can be viewed through the support portal HERE.

    Can you please send an e-mail to support@red-gate.com with your call reference in the subject field or update the call directly via the support portal (You will need to create a Red gate ID if you do not already have one) and update the call. Please attach a copy or an example T-SQL script that is encountering this problem for me to analyse.

    Many Thanks
    Eddie
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
  • Just in case others run into this error, I was able to find my issue and put a fix in. During the build process I was using to build a SQL Compare Diff script I was dynamically building a Version number inside a stored procedure. The dynamic SQL I was using to build this procedure did NOT have CR LF values for each line.

    The fix was to add the following code at the end of each line in the dynamic SQL:
    "+ char(13) + char(10) + "
    or is you would like to see it in the dynamic SQL:
    "
    DECLARE @sql varchar
    set @sql ='CREATE PROCEDURE sp_SetVersion' + char(13) + char(10) +
    'As' + char(13) + char(10) +
    'Begin' + char(13) + char(10) +
    'SET NOCOUNT ON' + char(13) + char(10) +
    ' declare @version varchar(10), @build varchar(10), @date datetime' + char(13) + char(10) +
    ' set @version = ''' + @vVer + '''' + char(13) + char(10) +
    ' set @build = ''' + @vbuild + '''' + char(13) + char(10) +
    ' select @date = getdate()' + char(13) + char(10) +
    ' delete from [version]' + char(13) + char(10) +
    ' INSERT INTO [version](dbversion,[MinProductVersionsXml],[LastUpgradedDateTime])' + char(13) + char(10) +
    'select @version + ''B'' + @build,CAST(''<MinProductVersions xmlns:xsd="http://www.w3.org/2001/XMLSchema&quot; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">' + char(13) + char(10) +
    '<application application_name = "AppName1" requesting_application_identity="1">'' + @version + ''</application>' + char(13) + char(10) +
    '</MinProductVersions>'' AS XML)' + char(13) + char(10) +
    ',GETDATE()' + char(13) + char(10) +
    'END'

    exec(@sql1)

    "

    The odd thing was this error was never reported in SQL versions prior to 2012
Sign In or Register to comment.