Backwards playing SPROC!

  • Hey everyone,

    So I have two servers. One is SQL Server 2000, and the other is SQL Server 7.0.

    On SQL Server 7 I have the following:

    CREATE proc USP_MySproc

    @Arg1 varchar(35),

    @Arg2 varchar(35),

    @Arg3 char(10)

    as

    print 1

    print 2

    GO

    On SQL Server 2000 I go to execute:

    EXEC OtherServer.master.dbo.USP_MySproc 'arg1', 'arg2', 'arg3'

    which returns

    2

    1

    I'm scared.

    /edit: They're linked servers and they show up in sp_linkedservers. The same procedure will work fine between two 2000 servers.

    //double edit: Running the exact code I provided returns the expected result, not the result I gave you. I'm looking for someone who has seen something like this before or thinks they can reason out why this would happen. I'll post 'working' code when it becomes available.

    ---
    Dlongnecker

  • Prints are buffered and are not returned the the client immediatly. While I've never seen multiple prints out of order, I have seen them greatly delayed. Try replacing the print with Select. If that comes back out of order, then I'm worried.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Ok, I have 4 prints in the code, and they returned out of order...

    Changing them to selects, they're in order, but one of them doesn't show. It literally is

    SELECT 'END'

    I can't think why it would print and not select.

    ---
    Dlongnecker

  • Replacing a cursor with a temporary table, a select max(id) and delete max(id) style approach appears to having everything running correctly and in order.

    You can consider this issue solved (although it doesn't do what the SQL 2000 version does, i need to work on that). I'm going to do lots of research on this particular sproc and see if I can find out why it's so crazy.

    I think I could literally hold a seminar on how weird this thing is.

    ---
    Dlongnecker

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply