Skip to Content.
Sympa Menu

freetds - Re: [freetds] RPC/Packet Type 3 Format

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddyz77 AT tin.it>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] RPC/Packet Type 3 Format
  • Date: Mon, 21 Jul 2003 08:23:27 -0000

I didn't read all messages related so perhaps some information will be
duplicated.
>
> 0030 f7 48 ca 56 00 00

This should be a TCP/IP info or other related.
> 03 01 00 fa 00 00 01 00

Header: type 3 (RPC) final, length 0xfa (correct)

> ff ff .H.V............

Length of store procedure name. TDS8 (mssql2k+, not mssql7) handle null
name (-1 length) using numbers instead of names (I know only some
numbers like 15 -> sp_unprepare).

> 0040 0b 00

This is RPC numbers... perhaps sp_executesql

> 00 00

flags

> 00 01 26 04 04 ff ff ff ff

output parameter, type INTN (0x26) length 4 (data and type length),
value -1

> 00 00 63 ......&........c

input parameter, NTEXT

> 0050 00 00 00 00

??? strange, must be length of type... perhaps I have to check tds
code...

> 09 04 00 01 32

collation info (0x409 = english)

> ff ff ff ff

length of text (NULL)

> 00 00 63 ........2......c

input NTEXT...

> 0060 ba 00 00 00

yes, this is length

> 09 04 00 01 32

collate

> ba 00 00 00

length

> 64 00 65 ........2....d.e
> 0070 00 63 00 6c 00 61 00 72 00 65 00 20 00 40 00 70 .c.l.a.r.e. .@.p
> 0080 00 34 00 20 00 69 00 6e 00 74 00 65 00 67 00 65 .4. .i.n.t.e.g.e
> 0090 00 72 00 0d 00 0a 00 65 00 78 00 65 00 63 00 20 .r.....e.x.e.c.
> 00a0 00 6a 00 64 00 5f 00 74 00 65 00 73 00 74 00 5f .j.d._.t.e.s.t._
> 00b0 00 30 00 30 00 31 00 20 00 40 00 70 00 31 00 3d .0.0.1. .@.p.1.=
> 00c0 00 33 00 2c 00 20 00 40 00 70 00 32 00 3d 00 27 .3.,. .@.p.2.=.'
> 00d0 00 74 00 65 00 73 00 74 00 27 00 2c 00 20 00 40 .t.e.s.t.'.,. .@
> 00e0 00 70 00 33 00 3d 00 20 00 27 00 30 00 37 00 2f .p.3.=. .'.0.7./
> 00f0 00 31 00 37 00 2f 00 32 00 30 00 30 00 33 00 27 .1.7./.2.0.0.3.'
> 0100 00 2c 00 20 00 40 00 40 00 70 00 34 00 3d 00 40 .,. .@.@.p.4.=.@
> 0110 00 70 00 34 00 20 00 6f 00 75 00 74 00 70 00 75 .p.4. .o.u.t.p.u
> 0120 00 74 00 0d 00 0a 00

just sql code you send

> 00 00 26 04 04 01 00 00 00 .t.......&......

input type INTN, length 4, value 1

>
> The actual SQL code is:
>
> declare @p4 integer
> exec jd_test_001 @p1=3, @p2='test', @p3= '07/17/2003', @@p4=@p4 output
>
> I'm confused about what appears to be some flags and info preceding the
> actual SQL code.

...

Well, any byte is decoded...

It's an RPC with parameters: -1 (output), NULL ntext, sql text, 1...
It seem an sp_prepare call... I don't understand where this code came
cause is not very good. A better way is to use RPC, withot sp_prepare...

I've learn two things:
- length of NTEXT is before collation information
- if parameter list is empty I can use a NULL value per parameters

freddy77






Archive powered by MHonArc 2.6.24.

Top of Page