Code Being Removed After Code Format

Discussion of open issues, suggestions and bugs regarding database management and development tools for SQL Server
Post Reply
Vegeta
Posts: 1
Joined: Thu 30 May 2013 06:18

Code Being Removed After Code Format

Post by Vegeta » Thu 30 May 2013 06:26

hi,

i am experiencing the following error. After trying to format the following Code (i know there is an error with the syntax) the code after the error is removed.

Code: Select all



DECLARE @Jurisdiction VARCHAR (20)
DECLARE @DMFlag VARCHAR (10)
DECLARE @BaselRunInd VARCHAR (10)

DECLARE @Date DATE
DECLARE @RecCount INT
DECLARE @StatusID INT

SET @Date = '2013-05-27'
SET @Jurisdiction = 'AUS'
SET @DMFlag = 'D'
SET @BaselRunInd = 'B3'



-------------------------------------------------------------------------------
-- Do Run audit
-------------------------------------------------------------------------------
SET @RecCount =
(
	SELECT
		COUNT(*)
	FROM Shared.auditRunTimes
	WHERE
		LEFT(CONVERT(VARCHAR, LoadDate, 126), 10) = @Date
		AND Jurisdiction LIKE @Jurisdiction
		AND DMFLAG LIKE @DMFlag
		AND BaselRunInd LIKE @BaselRunInd

)

IF @RecCount = 0
BEGIN


INSERT INTO Shared.auditRunTimes (
	Jurisdiction,
	DMFlag,
	BaselRunInd,
	StartTime, )
	VALUES
		(
			@Jurisdiction,
			@DMFlag,
			@BaselRunInd,
			GETDATE()
		)
END
ELSE
BEGIN

UPDATE Shared.auditRunTimes
SET
	EndTime = GETDATE()
WHERE
	LEFT(CONVERT(VARCHAR, LoadDate, 126), 10) = @Date
	AND Jurisdiction LIKE @Jurisdiction
	AND DMFLAG LIKE @DMFlag
	AND BaselRunInd LIKE @BaselRunInd



END
i am using version 4.0.72 Express Edition

thanks for your help

alexa

Re: Code Being Removed After Code Format

Post by alexa » Thu 30 May 2013 13:24

We were not able to reproduce this issue.

Could you please also provide us the resulting script after it has been formatted?

Post Reply