>No, when you define it as Varchar(100) you still can enter only 100 chars maximum.
>If you want to use CHAR(100) you just need to change the convert and use varchar() there. Then it will work also.
>
>GeographyTemporary -> CHAR(100)
>
>
>UPDATE ... SET ...
> GeographyTemporary='POINT('+CONVERT(varchar(100),Longitude)+' '+CONVERT(varchar(100),Latitude)+')'
>
>Because I doubt the Longitude or Latitude can exceed 100 chars each when you convert them.
>When you convert something to VARCHAR SQL Server converts it and remove all trailing spaces. When you convert it to CHAR() SQL Server add trailing spaces to match the length of the field.
Thanks, then, the maximum values for those would be:
POINT(-999.99999 -999.99999)
which would means that Char(28) would be big enough. Then, at the code level, as you mentioned, I would kept the usage of Varchar(100) just to have a proper conversion which would remove the trailing spaces and that should fit.
Is this pretty much the maximum optimization I could do here if I would want to keep the field definition to its minimum declaration?