Scripting Options – Quoted Identifier

by Jul 27, 2017

I prefer not to have quoted identifiers when I generate code, e.g.
CREATE TABLE dbo.TableName (
TableColumn1 varchar(25) NULL
)
vs.
CREATE TABLE [dbo].[TableName] (
[TableColumn1] varchar(25) NULL
)

However, when scripting out Users, this causes a problem for Windows Users that need to have the Quoted Identifiers
USE DatabaseName
GO
CREATE USER DOMAINWindowsUser
WITH DEFAULT_SCHEMA = dbo
GO
ALTER ROLE db_owner ADD MEMBER DOMAINWindowsUser
GO

This will not work and generates errors

Where it needs to be:
USE DatabaseName
GO
CREATE USER [DOMAINWindowsUser]
WITH DEFAULT_SCHEMA = dbo
GO
ALTER ROLE db_owner ADD MEMBER [DOMAINWindowsUser]
GO

Can ADS be smart enough to add Quoted Identifiers when needed?