Professional Web Applications Themes

I really need your help! - Microsoft SQL / MS SQL Server

Sorry for Subject of this email, but I really need some help: I have to update a table (T1) which has binary column. I have a list in another table (T2) of values in HEX in this way : 0x020000000000000000000000000000 0x020000000000000000000000000001 and so on. .... they are stored in an NTEXT column as string. I created this stored procedure: =========================================== CREATE PROC [dbo].[test_command_binary] tip1 binary(15) -- Or so? tip1 char(30) AS UPDATE TabRicerca SET binaryCol = tip1 WHERE Guid = '{6A4C4AA5-B9C5-49B7-AA0E-540640B0907E}' GO =========================================== where tip1 is value from T2. If I execute this from QA all works fine. As I ...

  1. #1

    Default I really need your help!

    Sorry for Subject of this email, but I really need some help:

    I have to update a table (T1) which has binary column.

    I have a list in another table (T2) of values in HEX in this way :

    0x020000000000000000000000000000
    0x020000000000000000000000000001
    and so on.
    ....

    they are stored in an NTEXT column as string.




    I created this stored procedure:


    ===========================================
    CREATE PROC [dbo].[test_command_binary]
    tip1 binary(15)
    -- Or so? tip1 char(30)
    AS
    UPDATE
    TabRicerca
    SET
    binaryCol = tip1
    WHERE
    Guid = '{6A4C4AA5-B9C5-49B7-AA0E-540640B0907E}'
    GO
    ===========================================


    where tip1 is value from T2.

    If I execute this from QA all works fine.

    As I have to update columns by an ASP page, when I try to pass this value
    from ADO in this way:

    [CUT]...

    tip1 = "0x020000000000000000000000000000"

    With cmd
    .CommandText = "test_command_binary"

    .Parameters.Append .CreateParameter("tip1",adBinary,adParamInput,15, tip1)

    Set Rs2 = .Execute
    End With

    [CUT]...

    It gives me an error...

    Also If i try to use HEX values without " "

    Please help me, today I must start with the update, I didn't think about
    this problem...

    Any help much appreciated

    regards

    --
    ==
    fabriZio




    fabriZio Guest

  2. #2

    Default Re: I really need your help!

    Hi,

    CREATE PROC [dbo].[test_command_binary]
    tip1 char(30)
    AS
    EXEC('UPDATE
    TabRicerca
    SET
    binaryCol = '+tip1+'
    WHERE
    Guid = ''{6A4C4AA5-B9C5-49B7-AA0E-540640B0907E}''
    ')

    -------
    SHINICHI YONEDA ne.jp
    Microsoft Most Valuable Professional
    MVP for SQL Server 2002-2003

    "fabriZio" <it> wrote in message
    news:phx.gbl... 
    ..CreateParameter("tip1",adBinary,adParamInput,15 ,tip1) 

    Shinichi Guest

  3. #3

    Default Re: I really need your help!

    Good Job Shinichi!!!!!

    It works!

    Thx very very much!!!!

    I love Japan!

    --
    ==
    fabriZio


    "Shinichi Yoneda" <ne.jp> ha scritto nel messaggio
    news:phx.gbl... [/ref]
    value 
    > .CreateParameter("tip1",adBinary,adParamInput,15, tip1) 
    >[/ref]


    fabriZio Guest

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139