Results 1 to 2 of 2

Thread: Create Stored Procedure

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2005
    Posts
    144

    Create Stored Procedure

    I need to create a stored procedure with this code. I cannot figure out why the code will not execute inside the stored procedure.
    Code:
    WITH temp_orgChart (dwgno, part, item, dim1, dim2, um, qty, iteration) AS
    (
    SELECT dwgno, part, item, dim1, dim2, um, convert(int, qty), 0
    FROM dbo.bomlog WHERE dwgno = 'tp134ae'
    
    UNION ALL SELECT b.dwgno, b.part, b.item, b.dim1, b.dim2, b.um, convert(int, b.qty) * convert(int, a.qty), a.iteration + 1
    
    FROM temp_orgChart AS a, dbo.bomlog AS b
    WHERE a.part = b.dwgno
    
    )
    
    SELECT dwgno, part, item, dim1, dim2, um, qty
    FROM temp_Orgchart
    WHERE um = 'si' OR um = 'in' or um = '"' or um = '"2'
    ORDER BY dwgno, part

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Create Stored Procedure

    This is just a guess but by "code will not execute" do you mean the results are not being returned to your VB app. Add a Set NoCount On statement at the beginning of the sproc (just after the As clause).

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