Query Analyzer Scripts Extra Blank Lines

  • Does anyone know why Query Analyzer will script an extra blank line when you edit an object?

    Steps to reproduce:

    1. Edit an object in QA, let's say a stored procedure, by right clicking on it in the object browser and choosing edit

    2. Execute the script

    3. Again, choose the stored procedure from the object browser and edit it

    4. Compare the two windows, and you will notice that the second one you pulled up has extra blank lines

    And you can repeat this over and over again, and it keeps adding blank lines.  Is there any way to stop this behavior?

  • Are the lines added at the top or the bottom of the code??

    Also one thing to might solve the problem is to use GO and the beginning and the end of the proc like :

    GO

    ALTER dbo.MyProc

    AS

    print 'test'

    GO

  • Actually, one blank line is added before and after the stored procedure.  Additionally, since I script it out using Query Analyzer it does insert the "GO" commands before and after the procedure also.

    Where this may become an issue is when using Red Gate Compare, between two servers, let's say a DEV and PRD machine.  If you want to note the differences, but you don't want to turn off the "Ignore spaces" option, because the formatting of the procedures matters to you.  Red Gate Compare flags these stored procedures as being different, because of the extra blank lines.

     

  • I just scripted and sp from QA and look at the first few lines

    SET QUOTED_IDENTIFIER ON

    GO

    SET ANSI_NULLS ON

    GO

    CREATE PROCEDURE [dbo].[AjouterProduit_CopyFrom] @NewCodeProduit as varchar(21), @NoProduit as int

    AS

    ....

    GO

    The blank line between the 2nd go and the create statement (or alter) will insert a blank line when it is run. There might be a similiar problem at the bottom of the scrip but I don't see one with my test.

  • I'm experiencing this issue as well. Did you ever find a resolution to this?

  • Can we see the EXACT script you run?

  • I've experienced this as well - a small thing but irritating none the less.

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply