SQL Prompt Bug
torsten.strauss
Posts: 268 Silver 3
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
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
Tagged:
Answers
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 Ruizit 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