Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003

    Arrow Unanswered: compare int to varchar, import 1.5 million rows (was "2 simple problem")

    1) I write a select statemnet

    select a.columname1, b.columname1
    from table1 a,table2 b
    where a.columname2 = b. columname3

    How do i compare
    a.columname2 <--> int type column
    while b. columname3 <--->varchar type

    how should i use convert function

    2) whats the best way to import 1.5 million rows ?
    How about text file

  2. #2
    Join Date
    Nov 2002
    1. CONVERT(varchar(15),a.columname2) = b. columname3

    2. Import? Text file? I'd use bcp

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Nov 2004
    on the wrong server
    Provided Answers: 6
    If b. columname3 is a numeric column you can always do the old

    1. select a.columname1, b.columname1
    from table1 a,table2 b
    where a.columname2 = CAST(b. columname3 as int)

    But if the values in columname3 are truly int you change your table definintion

    2. Depends on what the conditions are. I used to be a DTS guy but I just got done reading the entire Books Online documention regarding BCP and it is a lot more flexible and powerful than I used to think it was.
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts