Error : laying out SQL
torsten.strauss
Posts: 271 Silver 3
Hi Team,
trying to format the following batch will cause the mentioned error and the first line (-- Insert role user permission) is highlighted.
-- Insert role user permission
-- This table is just for demonstration purposes cause
-- user context name is passed by the API
-- SQL Prompt formatting off
INSERT permission.role_user
(ID_role, User_name)
VALUES
(1, 'Torsten')
, (2, 'xccx')
GO
-- SQL Prompt formatting on
-- Implement the index for the foreign key constraint
CREATE UNIQUE CLUSTERED INDEX UQCL_role_row_element_Element_UID_ID_role
ON permission.role_row_element (ELEMENT_UID, ID_role)
-- split possible
WITH FILLFACTOR = 80;
GO
SELECT * FROM Element
CROSS APPLY permission.tvf_get_role_permission(Element.ELEMENT_UID, N'xccx');
GO
Thanks for fixing this!
Regards!
Torsten
Friend of Redgate
trying to format the following batch will cause the mentioned error and the first line (-- Insert role user permission) is highlighted.
-- Insert role user permission
-- This table is just for demonstration purposes cause
-- user context name is passed by the API
-- SQL Prompt formatting off
INSERT permission.role_user
(ID_role, User_name)
VALUES
(1, 'Torsten')
, (2, 'xccx')
GO
-- SQL Prompt formatting on
-- Implement the index for the foreign key constraint
CREATE UNIQUE CLUSTERED INDEX UQCL_role_row_element_Element_UID_ID_role
ON permission.role_row_element (ELEMENT_UID, ID_role)
-- split possible
WITH FILLFACTOR = 80;
GO
SELECT * FROM Element
CROSS APPLY permission.tvf_get_role_permission(Element.ELEMENT_UID, N'xccx');
GO
Thanks for fixing this!
Regards!
Torsten
Friend of Redgate
Tagged:
Comments
Thanks for reporting this, it's an issue with the backwards compatible create index syntax (seen here ). We've got a fix for it here but as a workaround you can put the FILLFACTOR token in parenthesis and that should allow you to format
Hope this helps!
James
Redgate Software
We've just released version 8.0.3.1587 of SQL Prompt which should contain a fix for this issue
Hope this helps!
James
Redgate Software