1

I am new at using procedure with encryption, I tried altering my procedures to encrytped procedure. When there is no input parameter something like,

ALTER PROCEDURE [dbo].[Stock] WITH ENCRYPTION
     -- @Input_Parameter1 nvarchar(50) -> gives syntax error
AS
BEGIN
    SET NOCOUNT ON;

    select * from Inventory
END

It works. But when I add some input parameters between WITH ENCRYPTION and as it throws an error. How can I do that ?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Ali CAKIL
  • 383
  • 5
  • 21

2 Answers2

4

just you miss syntaxes

CREATE PROCEDURE [dbo].[Stock] 
@Input_Parameter1 nvarchar(50) --> gives syntax error
WITH ENCRYPTION
...
wiretext
  • 3,302
  • 14
  • 19
2

The WITH ENCRYPTION clause needs to be specified after the parameter declarations:

ALTER PROCEDURE [dbo].[Stock] 

@Input_Parameter1 nvarchar(50) 

WITH ENCRYPTION

AS

BEGIN

SET NOCOUNT ON;

SELECT * FROM dbo.Inventory;

END;
Dan Guzman
  • 43,250
  • 3
  • 46
  • 71