Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8069817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:11:00+00:00 2026-06-05T13:11:00+00:00

Okay the title cannot explain the situation correct enough. Now this is it, I

  • 0

Okay the title cannot explain the situation correct enough.
Now this is it,
I have a table with columns

Table1
Columns0, CHAR(20), NOT NULL.
Columns1, CHAR(4), Allow Nulls.
Data : 'ARR '

Table2
Columns0, CHAR(20), NOT NULL.
Columns1, CHAR(4), NOT NULL.
Data : 'ARR '

Then I join two tables together.

SELECT (ISNULL(a.Columns1,'') + ISNULL(b.Columns1,'')) AS WhatEver
FROM Table1 a 
left join Table2 b on a.Columns0 = b.Columns0

The result should appear as 'ARR ARR '
instead of this, it appear as 'ARRARR '

Why does this happen?


EDIT 2012/06/11:

After struggling, I ended up doing things like:

SELECT ISNULL(CONVERT(CHAR(4),a.Columns1),'') + ISNULL(b.Columns1,'')

Then only I get correct result 'ARR ARR '

But I am pretty sure my data type is CHAR(4) in the database.

Thank guys..


EDIT 2012/08/06:

Another solution that I found working is to change the TABLE 2 COLUMN 1 to (CHAR(4), NULL).
This can be done through
ALTER TABLE [table_name] MODIFY [column_name] [column_data_type] [null|not null]

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T13:11:02+00:00Added an answer on June 5, 2026 at 1:11 pm

    Your example works fine on my server (SQL Server 2008 R2):

    create table SOxx1
    (
        col1  char(4),
        col2  char(20) not null
    )
    
    create table SOxx2
    (
        col1  char(4),
        col2  char(20) not null
    )
    Go
    
    insert into SOxx1 (col1, col2) VALUES ('ARR ', 'abc')
    insert into SOxx2 (col1, col2) VALUES ('ARR ', 'abc')
    go
    
    SELECT (ISNULL(a.col1,'') + ISNULL(b.col1,'')) AS WhatEver 
    FROM SOxx1 a  
    left join SOxx2 b on a.Col2 = b.Col2
    
    -- OUTPUT is 'ARR ARR '
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay. Complex Title for a simple(?) problem. I have something like this going on
Okay. Complex Title for a simple(?) problem. I have something like this going on
Okay so here's the situation. I have this page of data. After the data
Okay, the post title might be a little confusing. I have this code: class
Okay, I have been messing with this autocomplete stuff for 2 weeks now, and
Okay, this is a little hard to explain, as the title might suggest. I
Okay so i have this code: if (isset($_GET['book'])) { $query= SELECT book_id, title, authors.`author`
Okay, I have done a bit of searching online and found this thread, but
Okay, none of the previous questions I have seen with this error seem to
Is there a better title for this? Okay, is something like this legal? var

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.