Results 1 to 8 of 8

Thread: stored procedure sanity check! [resolved]

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member thebloke's Avatar
    Join Date
    May 2003
    Posts
    358

    Resolved stored procedure sanity check! [resolved]

    Guys, I need a fresh pair of eyes to look at this:


    Code:
    'vbscript
    oConn.execute ("spVan_progress 2, " & session("van_id"))
    'where van_id = 3
    Code:
    'sp
    CREATE PROCEDURE spVan_progress
    (
    @step char(1),
    @ref bigint
    )
    AS declare @sql nvarchar(500)
    
    set @sql = 'update tblVan_counter set q ' + @step + ' = 1 where ref =  ' + @ref
    
    execute sp_execute1 @sql
    GO
    should have the effect of...

    Code:
    spVan_progress 2, 3
    'or
    update tblVan_counter set q2 = 1 where ref = 3
    The step variable is required so I can use the same sp to update any column. It should work (as far as I can see) but I get the error:

    Code:
    Microsoft OLE DB Provider for SQL Server (0x80040E07)
    Error converting data type varchar to bigint.
    The only bigint field in the table is 'ref' which I'm not altering. The q1 (q2, q3 etc) fields are bit.

    Any clues?!
    Last edited by thebloke; May 23rd, 2005 at 09:25 AM. Reason: resolved
    The Bloke
    www.blokeinthekitchen.com
    making cooking cool for blokes

Posting Permissions

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



Click Here to Expand Forum to Full Width