I was transferring data from a SQL Server database to another database (PDW).In source table there is a column with datatype (max). In destination it doesn't support datatype (max).
So what is the max value SQL Server considers for a dataype (max)?
I was transferring data from a SQL Server database to another database (PDW).In source table there is a column with datatype (max). In destination it doesn't support datatype (max).
So what is the max value SQL Server considers for a dataype (max)?
If you run the first line of code but put the particular column name and table name in (instead of [columname] and [tablename]).
Then run the second line of code with the table name and column name again replacing [columname] and [tablename], but with the number produced by the first piece of code between the brackets after nvarchar.
This will alter the column from max to a defined nvarchar length and maybe the other database should recognise this.
select max(len([columnname])) from [tablename]
alter table [tablename] alter column [columname] nvarchar()