SQL 2012 warning: "inconsistent line endings"

Compares and synchronizes SQL Server databases, backups and scripts.

Moderators: JonathanWatts, Chris Auckland, David Atkinson, eddie davis, Anu Deshpande, Michelle Taylor, alice.easey, james.billings, chengvoon.tong

SQL 2012 warning: "inconsistent line endings"

Postby cmorris73 » Fri Nov 22, 2013 6:57 pm

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.
cmorris73
 
Posts: 2
Joined: Fri Nov 22, 2013 6:46 pm

Postby eddie davis » Mon Nov 25, 2013 5:10 pm

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
Technical Support Engineer
Red Gate Software Ltd
E-mail: support@red-gate.com
eddie davis
 
Posts: 943
Joined: Wed Jun 14, 2006 3:47 pm
Location: Red Gate Software

Postby cmorris73 » Fri Dec 06, 2013 1:13 am

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" 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
cmorris73
 
Posts: 2
Joined: Fri Nov 22, 2013 6:46 pm


Return to SQL Compare 10

Who is online

Users browsing this forum: No registered users and 0 guests