Hi Redgate Team,

the following statement is valid but SQL Prompt raise an error.


/*******************************************************************************

    in-memory OLTP - Preparation

*******************************************************************************/

-- Create a memory optimized database
USE master;
GO

IF DB_ID('MemoryOptimized') IS NOT NULL
    BEGIN
        ALTER DATABASE MemoryOptimized SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
        DROP DATABASE MemoryOptimized;
    END;
GO

:SETVAR DataPath "E:\Microsoft SQL Server\MSSQL14.MYSQLSERVER2017A\MSSQL\DATA\"
:SETVAR LogPath "F:\Microsoft SQL Server\MSSQL14.MYSQLSERVER2017A\MSSQL\LOG\"
CREATE DATABASE MemoryOptimized
ON PRIMARY
       (
           NAME = MemoryOptimized_data
         , FILENAME = '$(DataPath)MemoryOptimized_data.mdf'
         , SIZE = 256MB
       )
 , FILEGROUP MemoryOptimized CONTAINS MEMORY_OPTIMIZED_DATA
       (
           NAME = MemoryOptimized_file
         , FILENAME = '$(DataPath)MemoryOptimized_file'
       )
LOG ON
    (
        NAME = MemoryOptimized_log
      , FILENAME = '$(LogPath)MemoryOptimized_log.ldf'
      , SIZE = 128MB
    );
GO


-- Increase the number of buckets
ALTER TABLE dbo.test ALTER INDEX NCL_test_col1 REBUILD WITH(BUCKET_COUNT = 2048);
GO

This is bad because formatting the statement fails and the cursor is send to the :SETVAR DataPath row even if you just highlight the last statement (ALTER TABLE).
It would great to see a fix in the next release - thanks!

Torsten
MVP, FoRG


torsten.strauss
0

Comments

4 comments

  • Pete_Ruiz

    Hello Torsten,


    Which error are you getting? Do you get an error when you try and format the query or after you try executing it?


    Can you share a screenshot of the error?


    Kind regards,


    Pete Ruiz
    Pete_Ruiz
    0
  • torsten.strauss
    Hi Pete,

    it would be nice to have a copy error message in the next release.
    Instead I added a screenshot of the message.
    The error occurs when I try to format the code.

    Thanks!

    Torsten
    torsten.strauss
    0
  • Pete_Ruiz
    Hi Torsten,

    Thanks for your patience on this one. We've finally gotten down to the root cause of the issue and have logged a bug which can now be referenced by SP-7583. We'll keep you updated on the progress of this bug.

    Cheers,

    Pete Ruiz
    Redgate Support
    Pete_Ruiz
    0
  • Pete_Ruiz
    Hello Torsten,

    We have now released a fix for the formatting bug reference SP-7583 (release notes).

    Can you please download the latest installer below and confirm that the issue is now resolved?

    Cheers,

    Pete Ruiz

    Redgate Support

    Pete_Ruiz
    0

Add comment

Please sign in to leave a comment.