Results 1 to 3 of 3
  1. #1
    tpcervelo is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    28

    Append to SQL table failing on data type

    I am trying to append records to a SQL table from an Access table. Not all fields will have data in every record...some fields may be blank. I get the following error when running the query. "You tried to assign the Null value to a variable that is not a Variant data type." By process of elimination the fields that are causing the error are of type (Varchar(nn), not null) in the SQL table. I have these fields defined as Text in the access table. Any idea on how I can get the records loaded for these type fields when thry are blank.
    Any help is much appreciated.

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    You must provide SOMETHING to SQL Server for that field if it is set to not allow nulls. I don't know your data to know what you could put there but that is the solution. Pass something to it to store in that field (those fields).

  3. #3
    tpcervelo is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    28

    Append to SQL table failing on data type

    Thanks for the pointer...it lead me to try two methods...both which seem to work. I could run an update query against my access table updating all null fields of that type to Space(1) or I could put IsNotNull in the criteria for those fields in the append query.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 10-06-2011, 08:37 AM
  2. one table per data type?
    By kman42 in forum Database Design
    Replies: 1
    Last Post: 06-05-2011, 03:40 PM
  3. change data type in make table query
    By jgelpi16 in forum Queries
    Replies: 2
    Last Post: 01-26-2011, 09:37 AM
  4. Replies: 1
    Last Post: 05-17-2010, 12:21 PM
  5. Replies: 2
    Last Post: 03-18-2010, 08:24 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums