How can we help you today? How can we help you today?

Error : laying out SQL

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
torsten.strauss
0

Comments

2 comments

  • James R
    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
    James R
    0
  • James R
    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
    James R
    0

Add comment

Please sign in to leave a comment.