#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Posts
    2
    Rep Power
    0

    SQL error when calling stored procedure


    Hello, I'm getting a syntax error when I try to use the following stored procedure in my aspx page:

    Code:
    CREATE PROCEDURE ILIB_upd_cat_info
     @ilib_category VARCHAR(255),
     @description VARCHAR(255),
     @last_modified DATETIME,
     @modified_by VARCHAR(255),
     @ilib_category_id INT
    AS
    DECLARE @err INT
    BEGIN TRANSACTION
    	UPDATE ilib_category 
    	SET ilib_category = @ilib_category, 
    		[description] = @description, 
    		last_modified = @last_modified, 
    		modified_by = @modified_by 
    	WHERE ilib_category_id = @ilib_category_id
    	SELECT @err = @@error
        	IF (@err != 0)
        	BEGIN
          	ROLLBACK TRANSACTION
          	return @err
        	END
    COMMIT TRANSACTION
    return 0
    GO
    If anyone can point out the syntax error in there, I'd greatly appreciate it!
    Thanks!
    -Dagta
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Posts
    2
    Rep Power
    0
    Nevermind. My error was not in SQL but in my C# code. I had forgotten:

    my_command.CommandType = CommandType.StoredProcedure;

    -Dagta

IMN logo majestic logo threadwatch logo seochat tools logo