Re: Append to SQL Server

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I have not seen that behavior before. Are you sure that the SQL field is defined as VarChar and not Char?

IF it is varChar then perhaps you can use the Trim or RTrim function on the memo field in the query. It is possible that the Access memo field does contain trailing spaces depending on how the data got into the memo field. Typing in the data will automatically remove any trailing spaces, but importing from another source that does have the spaces at the end or using code or an insert or update query will keep trailing spaces.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Sash wrote:
I have a SQL Server linked table in Access and I'm running an append query to populate this table. It works fine except if the field has 10 characters, 245 blank spaces are put at the end in SQL Server. The columns are set-up as VarChar in SQL Server and are a memo field in Access. The reason they are a memo field is that this field could contain 9 characters or 255 characters. However, I do not want SQL Server to consistently be 255 characters with blank spaces at the end.

The Access data truly does not have spaces at the end.
.



Relevant Pages

  • Truncated memo field in query & mail merge output
    ... If the memo field is greater than 255 characters, a query based on the sql ... daughter should now be wearing bermuda shorts and flip flops to school. ...
    (microsoft.public.access.externaldata)
  • Truncated memo field in query & mail merge output
    ... If the memo field is greater than 255 characters, a query based on the sql ... daughter should now be wearing bermuda shorts and flip flops to school. ...
    (microsoft.public.access.formscoding)
  • Re: text vs varchar
    ... you are better off with varchar as as long as you have ... text/ntext/image data types, such as not being table to declare local ... SQL Server MVP ... > I want to store some long text that could be about 4000-5000 characters ...
    (microsoft.public.sqlserver.programming)
  • Re: Varchar(MAX)
    ... since varchar uses 1 byte for each character, ... Or, in decimal form, 2,147,483,647 characters. ... Hugo Kornelis, SQL Server MVP ... My SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis ...
    (comp.databases.ms-sqlserver)
  • Re: Creating Forms & Adding Task Notes Field
    ... The Notes field itself supports more than 255 characters. ... SQL query to get at the information. ... memo field and have more than 255 characters) ...
    (microsoft.public.project.vba)