SQL 2012 warning: "inconsistent line endings"
cmorris73
Posts: 3
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
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
Senior Product Support Engineer
Redgate Software Ltd
Email: support@red-gate.com
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