Il mio obiettivo è quello di nascondere le colonne su SQL Server 2019.
Sto seguendo molto facile guida.
Ho eseguito la query AdventureWorks2014
e ho creato una copia di Person.Person
:
SELECT [BusinessEntityID]
,[PersonType]
,[NameStyle]
,[Title]
,[FirstName]
,[MiddleName]
,[LastName]
,[Suffix]
,[EmailPromotion]
,[AdditionalContactInfo]
,[Demographics]
,[rowguid]
,[ModifiedDate]
INTO [Person].[PersonMasked]
FROM [AdventureWorks2014].[Person].[PersonMasked]
ORDER BY BusinessEntityID
Ora sto andando a mascherare la colonna FirstName
come è scritto nella guida:
ALTER TABLE [AdventureWorks2014].[Person].[PersonMasked]
ALTER COLUMN FirstName NVARCHAR(10) MASKED WITH (FUNCTION = 'default()');
E ricevo l'errore:
Msg 8152, Level 16, State 30, Line 1
String or binary data would be truncated.
The statement has been terminated.
Completion time: 2021-11-23T15:32:43.0426983+01:00
Dove sbaglio?
Dove posso trovare la funzione FUNCTION = 'default()'
in sql server management studio?