Results 1 to 5 of 5

Thread: Sprocs

Threaded View

  1. #1

    Thread Starter
    Fanatic Member space_monkey's Avatar
    Join Date
    Apr 2005
    Location
    神と歩くこと
    Posts
    573

    Sprocs

    Ok i've created my first stored procedure and i have a couple questions. Don't laugh.

    Here's my sproc.
    Code:
    USE MWDB
    GO
    SET QUOTED_IDENTIFIER ON 
    GO
    SET ANSI_NULLS ON 
    GO
    if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[INSERT_ACCT_TAGS]') 
    and OBJECTPROPERTY(id, N'IsProcedure') = 1)
    drop procedure [dbo].[INSERT_ACCT_TAGS]
    
    GO
    
    CREATE PROCEDURE INSERT_ACCT_TAGS
    	 @ORDR_NUM varchar(20)
    	 ,@LINE_NUM varchar(20)
    	 ,@TRAK_NUM varchar(20)
    	 ,@DATE_TIM datetime
    	 ,@USER_NAM varchar(20)
             ,@PROD_LOC varchar(20)
    AS
    
    Set NoCount On
    
    Insert into ACCT_TAGS (ACCT_TAGS_ORDR, ACCT_TAGS_LINE, ACCT_TAGS_TRAK, ACCT_TAGS_DATE,
    ACCT_TAGS_USER, ACCT_TAGS_PROD) Values (@ORDR_NUM, @LINE_NUM, @TRAK_NUM, @DATE_TIM, @USER_NAM, @PROD_LOC)
    Go
    
    GRANT EXECUTE ON INSERT_ACCT_TAGS TO SPROC_USER
    Go
    SET QUOTED_IDENTIFIER OFF 
    GO
    SET ANSI_NULLS ON 
    GO
    It's simple, but that's usually a good place to start. Now my questions are...
    1. How do i use this in a vb program?
    2. How do you all handle user permissions with this? We use windows authentication right now, usually putting each person in a role so that they all have the right abilities.
    Last edited by space_monkey; Jan 9th, 2006 at 12:54 PM.
    Using VB6 or VB.net 2008 with .net 3.5
    "Life... death... either way I'll be confined to a small cubicle!" - Hermes Conrad

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