SQL Prompt Bug

torsten.strausstorsten.strauss Posts: 268 Silver 3
edited April 6, 2019 1:31PM in SQL Prompt
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


Answers

Sign In or Register to comment.