Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    SQL Code Folding

    Help wanted · · · – – – · · ·
    sql code folding
    2
    2
    53
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • dfs-
      dfs- last edited by

      Does anyone else notice the SQL code folding seem to have major issues. Using the following code:

      if @dbdump=1
      begin
          select @ret=status from master..sysdatabases where dbid=@dbid
          if @ret is null
          begin
              select @errno=50391, @textnach=@dbname
              goto error
          end
          -- select into/bulkcopy
          if @ret & 4 = 4
          begin
              exec master..sp__changedbopt @dbname, 'select into', false
          end
      end
      

      I’d suspect having three fold markers, one for the surrounding if…begin…end and two for the inner begin…end. I will receive those folding markers, but the outer one ends at the end in line 8.

      In the following screenshot only the selected text is folded when clicking on the marker in line 2, but it should actually span until line 14:

      798fd9e5-7bcc-43b2-a786-471516cf797e-image.png

      Why is that?

      Possibly relevant topic: https://community.notepad-plus-plus.org/topic/15073/folding-behavior-of-sql-code

      R 1 Reply Last reply Reply Quote 0
      • R
        rdipardo @dfs- last edited by

        Notepad++ does not have built-in support for Microsoft Transact-SQL: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/12610#issuecomment-1340297100

        That may change in a future release, but I would not hold my breath.

        1 Reply Last reply Reply Quote 2
        • First post
          Last post
        Copyright © 2014 NodeBB Forums | Contributors