Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Index scripting INCLUDE columns contain spaces and tab #279

Open
pamanes opened this issue May 4, 2023 · 0 comments
Open

Index scripting INCLUDE columns contain spaces and tab #279

pamanes opened this issue May 4, 2023 · 0 comments

Comments

@pamanes
Copy link

pamanes commented May 4, 2023

hi,

here's an example of how generate scripts wizard in SSMS scripts an index:

CREATE NONCLUSTERED INDEX [IX] ON [dbo].[Table]
(
[Account] ASC
)
INCLUDE([Col1],[Col2],[Col3]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO

and here's how this tool generates it:

CREATE NONCLUSTERED INDEX [IX] ON [dbo].[Table]
(
[Account] ASC
)
INCLUDE ( [Col1],
[Col2],
[Col3]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO

As you can see there's some weird spacing / tabs being added to the columns in the INCLUDE, is there a way to disable or prevent this?

thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant