1
Vote

Incorrectly remove comments

description

When I analyzed the TSQL script, the tool incorrectly removed the comments which contains TSQL statements inside the comment.
 
/*
USE [MyDatabase];
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[mySchema].[myProc]') AND type in (N'P', N'PC'))
DROP PROCEDURE [mySchema].[myProc];
GO
*/
 
turned into
 
*/

comments

Giavinh wrote May 10, 2012 at 9:52 PM

Sometimes it happens as below

/*
USE [MyDatabase];
GO
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[mySchema].[myProc]') AND type in (N'P', N'PC'))
DROP PROCEDURE [mySchema].[myProc]
GO
*/

turned into

IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[mySchema].[myProc]') AND type in (N'P', N'PC'))
DROP PROCEDURE [mySchema].[myProc]
GO
*/

ghuey wrote May 10, 2012 at 11:38 PM

Yes, I see the issue. It will be fixed in v3.8.8 & v4.0.1

I will respond back to this when I post the fix.

Thanks for reporting this.
George

ghuey wrote May 10, 2012 at 11:43 PM

Oh, as a side note, the logic flaw on my part is the "GO" inside the comments. I see the GO and start a new command. My bad.

ghuey wrote May 10, 2012 at 11:52 PM

Actually, let me correct myself. It is not the GO that was the issue, it was the "USE [MyDatabase]" that caused me the issue. SQLAzureMW looks for the "USE [MyDatabase]" commands and removes them since SQL Azure does not like them. The problem is:

1) I should not remove them from a comment line
2) Not only did I remove the USE statement, but I removed everything else through the GO.

Sorry,
George

ghuey wrote May 11, 2012 at 12:57 AM

Ok, I believe it is fixed in v3.8.8. Check it out and let me know if it didn't work.

Thanks,
George