Pergunta

I am trying to move a table from SQL server to AWS Redshift. While trying to move NVARCHAR fields, I read that Redshift converts NVARCHAR to VARCHAR internally. So, a NVARCHAR(100) in SQL Server will be equivalent to VARCHAR(100) or Varchar(200) in Redshift ? If I want to define the NVARCHAR fields from SQLServer directly as VARCHAR in Redshift, do I need to double the length of fields?

Foi útil?

Solução

Got the answer from aws.

NCHAR and NVARCHAR types are converted to CHAR and VARCHAR types, respectively, and are stored in the specified number of bytes. A VARCHAR(120) column consists of a maximum of 120 single-byte characters, 60 two-byte characters, 40 three-byte characters, or 30 four-byte characters. So, if I am storing double-byte characaters in SQL using NVARCHAR(x), I can define VARCHAR(2x) in Redshift to have the same storage behavior. Following is the link for further reference: http://docs.aws.amazon.com/redshift/latest/dg/r_Character_types.html

Licenciado em: CC-BY-SA com atribuição
Não afiliado a dba.stackexchange
scroll top