Filegroup / Error
torsten.strauss
Posts: 270 Silver 3
in SQL Prompt
Hi !
I have a database with two file groups. One is defined as default the other is named index.
If you now create an index or primary key constraint SQL Prompt will suggest the Default and the Index Filegroup which is fine.
But if you select the Default one it is not surrounded by brackets [], therefore parsing fails.
Would be nice to see a fix - thanks!
I have a database with two file groups. One is defined as default the other is named index.
-- !Change the path according to your server configuration
-- !Consider to send the index file and log files to another physical volumne
:SETVAR DataPath "E:\Microsoft SQL Server\MSSQL14.MYSQLSERVER2017A\MSSQL\DATA\"
:SETVAR LogPath "F:\Microsoft SQL Server\MSSQL14.MYSQLSERVER2017A\MSSQL\LOG\"
-- !Consider to change the size and filegrowth for the data and log files
CREATE DATABASE MDS_Master
ON PRIMARY
(
NAME = N'MDS_Master'
, FILENAME = N'$(DataPath)\MDS_Master.mdf'
, SIZE = 256MB
, FILEGROWTH = 0
)
, FILEGROUP Data
(
NAME = N'MDS_Master_Data'
, FILENAME = N'$(DataPath)\MDS_Master_Data.ndf'
, SIZE = 2GB
, FILEGROWTH = 0
)
, FILEGROUP [Index]
(
NAME = N'MDS_Master_Index'
, FILENAME = N'$(DataPath)\MDS_Master_Index.ndf'
, SIZE = 3GB
, FILEGROWTH = 0
)
LOG ON
(
NAME = N'MDS_Master_Index_Log'
, FILENAME = N'$(LogPath)\MDS_Master_Index_Log.ldf'
, SIZE = 512MB
, FILEGROWTH = 0
);
GO
-- Set data filegroup as default
ALTER DATABASE MDS_Master MODIFY FILEGROUP Data DEFAULT;
GO
If you now create an index or primary key constraint SQL Prompt will suggest the Default and the Index Filegroup which is fine.
But if you select the Default one it is not surrounded by brackets [], therefore parsing fails.
Would be nice to see a fix - thanks!
ALTER TABLE mdm.Import_Status
ADD CONSTRAINT PKCL_Import_Status_id_import_status
PRIMARY KEY CLUSTERED (id_import_status)
WITH (FILLFACTOR = 100) ON DEFAULT; -- missing brackets
GO
Torsten
Torsten
Tagged:
Answers
Thanks for reporting it!
I've reproduced and escalated it to the development team.
I'll keep you informed.
Tianjiao Li | Redgate Software
Have you visited our Help Center?
I'm pleased to let you know this bug has been fixed.
Please upgrade to the latest version 9.5.16.11294
Tianjiao Li | Redgate Software
Have you visited our Help Center?