Error : laying out SQL

torsten.strausstorsten.strauss Posts: 271 Silver 3
edited June 7, 2017 1:16PM in SQL Prompt
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
Tagged:

Comments

  • James RJames R Posts: 104 Silver 4
    Hi @torsten.strauss ,

    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
    Software Engineer
    Redgate Software
  • James RJames R Posts: 104 Silver 4
    Hey again @torsten.strauss ,

    We've just released version 8.0.3.1587 of SQL Prompt which should contain a fix for this issue :)

    Hope this helps!
    James
    Software Engineer
    Redgate Software
Sign In or Register to comment.